SteveDave Posted May 21, 2010 Share Posted May 21, 2010 Hello everyone, in hopes to stop all of the cheating going on in my game, I decided it's about time to disable refreshing. I've looked into this, and seen other games do it, but I haven't found any solid script or help for it yet. I imagine it would be a pretty simple javascript. I'm not too familiar with javascript, I have only used it a few times in my game so far. If someone could help me out with this I'd appreciate it very much. Auto refreshing has become a huge problem in many games, I think this could help a lot of people. If someone wants to throw it together and post it here as a free mod (I don't think it has been added yet) I'd gladly give them $5 for it. Thanks, Steve. Quote Link to comment Share on other sites More sharing options...
AlabamaHit Posted May 21, 2010 Share Posted May 21, 2010 Javascript or Ajax really isn't a good way, an user can turn that off.. Just an idea maybe someone can help with this..Using sessions if(isset($_POST['stuff'])) { if(isset($_SESSION['stop_refresh'])) { unset($_SESSION['stop_refresh']); echo 'Ok'; } else { echo 'no'; } } else { $_SESSION['stop_refresh'] = mt_rand(1,5000); echo 'Your page stuff <form action="PAGE" method="post"> <input type="text" name="stuff" value="Whatever" /> <input type="submit" value="Send" /> </form>'; } I would think something along these lines would be best.. Quote Link to comment Share on other sites More sharing options...
Spudinski Posted May 21, 2010 Share Posted May 21, 2010 Refreshing a page, doesn't enable cheating. Why would you want to take the ability to refresh a page away from a user? Please explain. Quote Link to comment Share on other sites More sharing options...
Djkanna Posted May 21, 2010 Share Posted May 21, 2010 I suppose while attacking, opening a new tab and going to buy health from the shop then going back to the attack tab but that's not exactly refreshing but yeah. Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted May 21, 2010 Share Posted May 21, 2010 Main areas for this type of cheating is areas in your game which can earn a little bit of money and exp where the player can load the same page to gain quickly. Quite common for the lowest crimes which although gains a small amount has less chance them getting jailed or put in the hospital. $10 refreshed all day can quite build up quite nicely. Make sure you have your captcha set to a reasonable rate. Or change it to a click value. Or both! 8 minutes or 100 clicks for example. Set a session routine as Alabama stated. Its not cheating in a sense...just using a loophole in the game to gain quicker than you should but its a good thing to stop. Quote Link to comment Share on other sites More sharing options...
Guest Drizzle Posted May 21, 2010 Share Posted May 21, 2010 As for this, disabling refresh is not needed. If your worried about macro bots that do repeated tasks, use a captcha for every ( x ) amount of crimes done, times trained, etc. I suggest reCaptcha, as it isn't that hard to integrate and its much better than default mccodes one. As for attacking and opening a new page, make something to see if the user is attacking, and if they open a new tab while attacking, they lose their experience and health. Oh and a good idea is to create a mysql table in phpmyadmin that will update when a user fails a captcha, and if they fail too many times, they get fed jailed for a day Quote Link to comment Share on other sites More sharing options...
Spudinski Posted May 23, 2010 Share Posted May 23, 2010 Bah, the hell with CAPTCHAs. There are many bots that can read the MCCodes CAPTCHA. Though, the attacking thingy you spoke about; there is a session defined when attacking(can be located in attack.php) and also a check to see if your on the actual attacking page(located in header.php). In theory, opening any other page while attacking, would set the players experience points to zero, null - nada. And you will never stop anyone who wants to browse in multiple tabs, or who wants to refresh their page. The user is making use of the new web technologies, why don't you adapt your game to it as well? Quote Link to comment Share on other sites More sharing options...
Agon Posted May 23, 2010 Share Posted May 23, 2010 I have figured out a way to manipulate the Stalemate feature using refresh. Just thought I'd let people know. So I think stopping refreshing is a good idea. Quote Link to comment Share on other sites More sharing options...
Zeggy Posted May 23, 2010 Share Posted May 23, 2010 Trying to stop browser refresh is like trying to stop the mouse from leaving the window or the user from entering a url to navigate away from your page - it's impossible. If you're trying to prevent refreshing, then your problem lies somewhere else (like in your code). Rewrite your features so refreshes are harmless. For example, refreshing a page after performing an action should only reload the result message, not the database update/insert. Quote Link to comment Share on other sites More sharing options...
Guest Drizzle Posted May 23, 2010 Share Posted May 23, 2010 Bah, the hell with CAPTCHAs. There are many bots that can read the MCCodes CAPTCHA. Though, the attacking thingy you spoke about; there is a session defined when attacking(can be located in attack.php) and also a check to see if your on the actual attacking page(located in header.php). In theory, opening any other page while attacking, would set the players experience points to zero, null - nada. And you will never stop anyone who wants to browse in multiple tabs, or who wants to refresh their page. The user is making use of the new web technologies, why don't you adapt your game to it as well? I was talking about something like reCaptcha. McCodes Captcha sucks. Quote Link to comment Share on other sites More sharing options...
Agon Posted May 24, 2010 Share Posted May 24, 2010 Trying to stop browser refresh is like trying to stop the mouse from leaving the window or the user from entering a url to navigate away from your page - it's impossible. If you're trying to prevent refreshing, then your problem lies somewhere else (like in your code). Rewrite your features so refreshes are harmless. For example, refreshing a page after performing an action should only reload the result message, not the database update/insert. Excellent point Zeggy. Quote Link to comment Share on other sites More sharing options...
SteveDave Posted May 26, 2010 Author Share Posted May 26, 2010 Good points made, there are definitely other ways to go about this than disabling refresh I have added a basic captcha for now, will probably be changing it to reCaptcha as Drizzle suggested because it's by far the best I have seen. Spudinski, I really don't mind my players using refresh, it's auto-refresh programs or addons that I am concerned about. In my game there are items for refilling brave/energy so people have their auto-refreshers going (doing both crimes and training the gym). Captcha only does so much because most of the time these people are still at their computer, they're just doing other things like watching a movie or whatever else they feel like doing which makes it very unfair for those players who actually sit there for hours at a time playing the game like it's meant to be played. But I have already decided on some changes I will be making to slow this down if not stop it completely. You're right, the game needs to adapt. Quote Link to comment Share on other sites More sharing options...
mamba Posted May 26, 2010 Share Posted May 26, 2010 How much will you pay for mod who is generating random number like this: http://warp.izhr.com/t/rand1/ (refresh link, it will generate different number and color lines each time) Need more details? :) Quote Link to comment Share on other sites More sharing options...
TRD_Dusty Posted May 26, 2010 Share Posted May 26, 2010 I suppose while attacking, opening a new tab and going to buy health from the shop then going back to the attack tab but that's not exactly refreshing but yeah.I have a attack.php for V1 that stop that. you would not be able to click attack and stop refill your health and then attack again... when you click attack on there profile it will ask you what you want to attack with and then it will run the whole attack with no stops. from step 1 right to the last step and it cant be stopped that I know of. I don't know much about this code it was on the game code that I got but Ill shear it with you guys. if you need more with it let me know what you need and ill look for it . If you email me Ill send it to you. Im having a bit of a problem posting the code on here.. it seems to want to run all together [email protected] AGAIN this is for V1 so to use it on V2 you would need to convert it. Quote Link to comment Share on other sites More sharing options...
CJ - Twitch Posted May 26, 2010 Share Posted May 26, 2010 How much will you pay for mod who is generating random number like this: http://warp.izhr.com/t/rand1/ (refresh link, it will generate different number and color lines each time) Need more details? :) Well, awesome graphics maker of tc, it would be useless unless you sold it as a captcha. http://makewebgames.io/index.php?page=RMarketplaceEntry&entryID=137 So i suggest about $5. :) Quote Link to comment Share on other sites More sharing options...
mamba Posted May 26, 2010 Share Posted May 26, 2010 Thanks ;) I am using this "picture" as my own captcha in warp.izhr.com - but little bit modified (numbers are rotating etc...) It is using; user DB modified 3 PHP scripts + 1 additional file. Quote Link to comment Share on other sites More sharing options...
Guest Posted May 29, 2010 Share Posted May 29, 2010 I suppose while attacking, opening a new tab and going to buy health from the shop then going back to the attack tab but that's not exactly refreshing but yeah. Simple fix to fix that, though most people don't think right to fix that. It's a simple fix for even new people. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.