Jump to content
MakeWebGames

BlueDevil23

Members
  • Posts

    328
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

BlueDevil23's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I'm sneaky. I like to surprise ya.
  2. Good to see a lot of old names still around!
  3. Haha, it definitely is.
  4. It doesn't directly add security, just another way of calling the same file. It's more or less a preference thing :)
  5. I believe this is a gym I secured and threw together for someone back in the day, or maybe just something I did for fun. I don't remember anymore haha. It's nothing special, a little more aesthetically pleasing and secure to my knowledge. Thought I'd release it for the hell of it, it's just sitting around. Thanks to Lilith and dominion for testing it out for me on their test servers, to make sure it wasn't bugged :)   <?php $macropage = "gym.php"; require_once "globals.php"; ($ir['hospital'] ? die("This page cannot be accessed while in hospital.") : FALSE); $statnames = array ( 'Strength' => 'strength', 'Agility' => 'agility', 'Guard' => 'guard', 'Labour' => 'labour' ); $_POST['amnt'] = (!empty($_POST['amnt']) && ctype_digit($_POST['amnt']) && isset($_POST['amnt']) ? abs(@intval($_POST['amnt'])) : ""); $_POST['stat'] = (!empty($_POST['stat']) && ctype_alpha($_POST['stat']) && isset($_POST['amnt']) ? htmlentities(trim($_POST['stat'])) : ""); $gymname = ($ir['jail'] ? "Jail Gym" : "Gym"); echo "<h1> {$gymname} </h1>"; if($_POST['stat'] && $_POST['amnt']) { $stat = $statnames[$_POST['stat']]; (!$stat ? die("This stat cannot be trained or it does not exist") : FALSE); if($_POST['amnt'] > $ir['energy']) { echo "You do not have enough energy to train that much"; } else { $gain = 0; for($i=0; $i<$_POST['amnt']; $i++) { $gain += mt_rand(1,3) / mt_rand(800,1000) * mt_rand(800,1000) * (($ir['will'] + 20) / 150); $ir['will'] -= mt_rand(1,3); ($ir['will'] < 0 ? $ir['will'] = 0 : $ir['will'] = $ir['will']); } ($ir['jail'] ? $gain /= 2 : FALSE); $statUp = sprintf("UPDATE `userstats` SET `%s` = `%s` + %d WHERE (`userid` = %u)", $stat, $stat, abs(@intval($gain)), abs(@intval($userid))); $do_statUp = mysql_query($statUp); if($do_statUp === FALSE) { echo "".mysql_error().""; } $adjUser = sprintf("UPDATE `users` SET `will` = %d, `energy` = `energy` - %d WHERE (`userid` = %u)", abs(@intval($ir['will'])), $_POST['amnt'], abs(@intval($userid))); $do_adjUser = mysql_query($adjUser); if($do_adjUser === FALSE) { echo "".mysql_error().""; } $inc = abs(@intval($ir[$stat] + $gain)); $inc2 = abs(@intval($ir['energy'] - $_POST['amnt'])); if($stat == "strength") { printf(" You begin lifting some weights. You have gained %d strength, by doing %d sets of weights. You now have %d strength and %d energy left. </p>", abs(@intval($gain)), $_POST['amnt'], $inc, $inc2); $_SESSION['checked'] = 1; } elseif($stat == "agility") { printf(" You begin running on a treadmill. You have gained %d agility, by doing %d minutes of running. You now have %d agility and %d energy left. </p>", abs(@intval($gain)), $_POST['amnt'], $inc, $inc2); $_SESSION['checked'] = 2; } elseif($stat == "guard") { printf(" You jump into the pool, and begin swimming. You have gained %d guard, by doing %d minutes of swimming. You now have %d guard and %d energy left. </p>", abs(@intval($gain)), $_POST['amnt'], $inc, $inc2); $_SESSION['checked'] = 3; } elseif($stat == "labour") { printf(" You walk over to some boxes filled with gym equipment and start moving them. You have gained %d labour, by moving %d boxes. You now have %d labour and %d energy left. </p>", abs(@intval($gain)), $_POST['amnt'], $inc, $inc2); $_SESSION['checked'] = 4; } $ir['energy'] -= $_POST['amnt']; $ir[$stat] += $gain; } } $checked1 = (($_SESSION['checked'] == 1) ? "checked='checked' />" : "/>"); $checked2 = (($_SESSION['checked'] == 2) ? "checked='checked' />" : "/>"); $checked3 = (($_SESSION['checked'] == 3) ? "checked='checked' />" : "/>"); $checked4 = (($_SESSION['checked'] == 4) ? "checked='checked' />" : "/>"); $ir['strank'] = get_rank($ir['strength'],'strength'); $ir['agirank'] = get_rank($ir['agility'],'agility'); $ir['guarank'] = get_rank($ir['guard'],'guard'); $ir['labrank'] = get_rank($ir['labour'],'labour'); echo <<<EOF2 <style type="text/css"> legend { margin-left: 1em; color: #FFF; font-weight: bold; } fieldset ol { padding: 1em 1em 0 1em; list-style: none; } fieldset ol li { float: left; clear: left; width: 100%; padding-bottom: 0.5em; } label { float: left; width: 10em; margin-right: 1em; font-weight: bold; } fieldset.submit { float: none; width: auto; border-style: none; padding-left: 12em; background-color: transparent; background-image: none; } .padder { padding: 0 5px 15px 5px; } dl { width: 500px; } dt { float: left; width: 300px; } dd { float: right; width: 200px; margin-top: -11px; } </style> <h3> Choose the stat you want to train and the times you would like to train it</h3> <h3> You can train up to {$ir['energy']} times </h3> <div class="padder"> <fieldset> <legend> Gym </legend> <form action="gym.php" method="POST"> [list=1] [*] <label for="strength"> Strength (Have {$ir['strength']}, Ranked {$ir['strank']}) </label> <input type="radio" name="stat" value="Strength" $checked1 [*] <label for="agility"> Agility (Have {$ir['agility']}, Ranked {$ir['agirank']}) </label> <input type="radio" name="stat" value="Agility" $checked2 [*] <label for="guard"> Guard (Have {$ir['guard']}, Ranked {$ir['guarank']}) </label> <input type="radio" name="stat" value="Guard" $checked3 [*] <label for="labour"> Labour (Have {$ir['labour']}, Ranked {$ir['labrank']}) </label> <input type="radio" name="stat" value="Labour" $checked4 [*] <label for="amnt"> Times to Train </label> <input type="text" name="amnt" value="{$ir['energy']}" /> [*] <input type="submit" class="submit" value="     Train     " /> [/list] </form> </fieldset> EOF2; $h->endpage(); ?>
  6. I had a raw, functioning one, I worked on back in the day. I'll try and see if I can find the code somewhere on my computer. I unfortunately couldn't find my old AJAX gym, must have left it on the server, which is down now. Sorry.
  7. I had a raw, functioning one, I worked on back in the day. I'll try and see if I can find the code somewhere on my computer.
  8. Haha thanks, but I thought I'd repost it for everyone for free, because it's probably not even efficient code anymore with the way things change in the programming world, but who knows.
  9. Thanks Danny 696. And thanks Jordan Palmer, glad to hear it's still running smoothly. :)
  10. Haha, I was hoping no one got too bothered about a dollar.. hah And thanks, it's good to be back! :) Oh, and could you let me know if it still is working?
  11. Old paid mod. I don't programm anymore, so I will not provide any support for this anymore, sorry hah. I'm not even sure if it works anymore, because Yahoo might have changed their Weather API on me, but I don't know. Someone let me know.
  12. Ha, well it's good to see some people I remember, and thanks for all the welcome backs. I'm not exactly sure I'll be around more, again, but I'll probably check in more often. I don't really programm anymore, but glad to see you guys are still at it! :)
  13. BlueDevil23

    Hello?

    Anyone remember me?!
  14. I might :P ... PM with more info, and exacts, or preferrably add me on IM MSN: [email protected] Yahoo: [email protected]
  15. I am now taking(Actively seeking... more like it) mod requests for paid work. So if you have something on your mind, you'd like in your game, give me a holler :)
×
×
  • Create New...