Me, Matt and a few guys from other sites were going to make a clientless fishing bot. I know Matt had been unable to figure out the captcha, and I had barely started. I've been procrastinating all afternoon on an essay I have due tomorrow, and I did some work on the fishing bot.
I was going to code it all in Python. I remembered that Terry had already done a lot of the work previously, so I scoured Google for a copy of his old program "A Fishermans Friend". Unfortunately the copy I found was only partially complete, and a lot of the completed code was incompatible with the current setup, however I've been working on it all afternoon and have recoded a lot of it so that it now works, at least roughly. It's successfully able to save the fish to your inventory. The copy I have is still far from being ready for a public release, however I thought I would share how to handle the captcha.
Matt had already alluded partially to the process. And really, the process is very simple, so I don't see how you have had a problem with it izzy:. When you're ready to save, the first step is to request the captcha from the following URL:
The only variable that should change in that address is the X var, which is the current time. Leave everything else alone. You should receive a return somewhere along the lines of the following:Code:http://www.gaiaonline.com/chat/gsi/index.php?X=1307010135076.65&v=sushi&m=3009%01fishing%0193e5f8c7e4e3d0d22a695c2ec1a6bff0ca3ab67fc96446ea
Which is this image:Code:3009http://api.recaptcha.net/image?c=03AHJ_VusAze7AzZpYaeyp7eKW85xcBJ2nR3Ip3McCeVD4ccV_cRaMRmDdc2wwoXiBKNRls9Yq56-mJuVe7dYAkq4sGSvOLTHbYQ8-HegWnyd0qoASNij-ig9J2nS_ocWb4Xn9_FKEsS1Fx4puAk1HydOHf1dNRa6ThQ
In case you can't read those characters after the 3009, its chr(1) + chr(5) + chr(1). So split by that and you'll have the URL to the captcha image. Simply use that URL to load the captcha, and save the result in a string somewhere. Now, here's the thing that originally confused me. Most of these applications require you to pass through the challenge and the captcha text. i.e., from the above example:
Challenge (the identifier in the URL):
Captcha text:Code:03AHJ_VusAze7AzZpYaeyp7eKW85xcBJ2nR3Ip3McCeVD4ccV_cRaMRmDdc2wwoXiBKNRls9Yq56-mJuVe7dYAkq4sGSvOLTHbYQ8-HegWnyd0qoASNij-ig9J2nS_ocWb4Xn9_FKEsS1Fx4puAk1HydOHf1dNRa6ThQ
However, Gaiaonline remembers the challenge serverside (likely as a session). So all you have to do is send back the captcha text as part of the final send request. That's why it's impossible to bypass the captcha (and everyone who claims they can is full of shit). If you don't pass back captcha text, or don't request a captcha, etc. the server will simply detect it and not accept it.Code:alimer scious
Now, the ActionScript function to save the game is as follows:
It's the final 10 or so lines you should focus on at first. _loc6 is the array of values to send through with the request. You should be familiar with the setup, as each request to their sushi server is in the same format. So, going through them:Code:function savingGame() { if (_root.playAsGuest) { _root.main.continueGame(); return (undefined); } var _loc3 = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); var _loc8 = ""; var _loc9 = new Object(); var _loc5 = ""; var _loc7 = "|"; if (_root.whichLake == "bassken") { _loc9.pondMap = 0; var _loc4 = new Array(100005, 100004, 100006, 100007, 100008, 100021, 100020, 100019, 100028, 100029, 100022, 100023, 100034, 100035, 100040, 1000523, 1000463, 1000465, 1000467, 1000469, 1000471, 1000473, 1000503, 1000501, 1000499); } else if (_root.whichLake == "gambino") { _loc9.pondMap = 1; _loc4 = new Array(100009, 100010, 100011, 100012, 100013, 100021, 100020, 100019, 100031, 100030, 100024, 100025, 100036, 100037, 100041, 1000523, 1000475, 1000477, 1000479, 1000521, 1000519, 1000517, 1000515, 1000513, 1000511); } else if (_root.whichLake == "durem") { _loc9.pondMap = 2; _loc4 = new Array(100014, 100015, 100016, 100017, 100018, 100021, 100020, 100019, 100033, 100032, 100026, 100027, 100038, 100039, 100042, 1000523, 1000481, 1000483, 1000485, 1000509, 1000507, 1000505, 1000493, 1000495, 1000497); } if (_root.main.myFish.length > 0) { for (var _loc2 = 0; _loc2 < _root.main.myFish.length; ++_loc2) { ++_loc3[_root.main.myFish[_loc2]]; } for (var _loc2 = 0; _loc2 < _loc3.length; ++_loc2) { if (_loc3[_loc2] > 0) { _loc8 = _loc8 + (_loc4[_loc2] + "" + _loc3[_loc2]); _loc5 = _loc5 + (_loc4[_loc2] + ":" + _loc3[_loc2] + _loc7); } } } else { _loc5 = _loc5 + _loc7; } var _loc11 = _root.main.fishData.sid2 + _root.gsiUserData.gaia_id + _root.main.fishData.sid3; var _loc10 = _loc8 + _root.main.fishData.sid3; var _loc6 = new Array(); _loc6[0] = "510"; _loc6[1] = _loc9.pondMap; _loc6[2] = _loc5; _loc6[3] = calcMD5(_loc11); _loc6[4] = calcMD5(_loc10); _loc6[5] = _root.gsiUserData.gaiaSID; _loc6[6] = _root.captcha_panel.passcode; sushi.callPlugin("G_FISH_PLUGIN", _loc6, savingGame_CB, _root); }
So, provided you request the captcha and then send through the valid text, the bucket should save! Let me know if you have any questions.Code:0 - the method number to invoke. 510 is saving the game. 1 - which pond you're in. 0 = bassken 1 = gambino 2 = durem 2 - ids of fish and how many. i.e. 100015:2|100016:3|100017:3|100026:1|100027:2|100038:2|100039:5| (see how its calculated above) 3 - see how it's calculated above 4 - see how it's calculated above 5 - Gaiaonline session id 6 - the captcha text (in this case alimer scious)
Results 1 to 11 of 11
Thread: Captcha with the fishing bot
- 02 Jun. 2011 11:22am #1
Captcha with the fishing bot
- 02 Jun. 2011 06:38pm #2
- 02 Jun. 2011 06:48pm #3
Here's an old version of Mulefarm, I found it while going through some private message archives from '08. It's a kinda old version, but figured it couldn't hurt.
mulefarm - Minus// Signature
- 03 Jun. 2011 02:50am #4
- 04 Jun. 2011 02:05am #5
After this weekend I can get a hold of my external HD and lookup old sources from Terry if you still need them, or want them as reference.
Anything I can help with?
- 04 Jun. 2011 02:12am #6
To be honest, I deliberately used Terry's very first fishing program rather than Mulefarm because it was far simpler and less complete. I didn't really want to take Mulefarm and just fix it up, I actually felt like doing a bit of work myself :p And thanks re: the sources, but it's all in hand now. I ran through around 100 buckets last night while I was asleep and the bot worked perfectly. I just have to code the GUI component and fix a bit of it up.
- 04 Jun. 2011 03:41am #7
Nice! PyQT is a good GUI framework. Looks better than Tkinter (unless they changed the graphics on it).
---------- Post added at 03:41 AM ---------- Previous post was at 039 AM ----------
On a side note, did you take a look at my post in BaseCamp?
- 04 Jun. 2011 04:05am #8
Yea, sorry, I've been meaning to reply. I used to use HTTrack all the time at work, but only on Windows. I didn't really know it could be run on linux. I'm looking trk on this project a lot during my 6 weeks off (starting next friday). Do you think you'll have time? If not, I'll probably just configure the spider myself.
- 04 Jun. 2011 04:20pm #9
Yeah, I can try and set it up. I have some free time this weekend. I should be able trk on it after work on the week also, it's just that I don't have internet in my apt. and I have trk in a common area... and it's REALLY uncomfortable.
- 06 Jun. 2011 04:32am #10
- 06 Jun. 2011 11:36pm #11
Yeah, it's kind of a bitch to set it up. Once you get it it's smooth sailing though.
How-to: Deploying PyQt applications on Windows and Mac OS X
^ Might help you out if you decide to give it another try. You could set it up in Windows, I think there's a link in my signature to a tutorial I made long ago on how to set it up in Windows.
---------- Post added at 116 PM ---------- Previous post was at 10:46 PM ----------
I installed Httrack in your server. Just use command httrack to run it, it will start a new project. I'm going to look up some information regarding filtering and limits that can be applied for customization.