FitzChivalry Posted June 20, 2008 Share Posted June 20, 2008 Ok, had some spare time today, so I decided to see if I could get the bot to click on ads as it goes through the words. I've tested this on my machine, and it seems to be working fine. It was actually a lot easier than I thought it would be, turns out that the ads are alway's the 14th link on the page, so just using _IELinkClickByIndex ($oIE, 13, 0) seems to work without any problems. Right now the bot is set to randomly click on an ad 1/30th of the time. That might be too frequent, if it is just change the max random number to a higher one. Comments and improvements welcome! expandcollapse popup#include <IE.au3> #include <INet.au3> #include <String.au3> #include <GUIConstants.au3> Global $Correct = 0, $False = 0, $First = 1, $Label, $Timerdiff, $Formtitle, $Minute = 0, $Ads =0 $oIE = _IECreate("http://freerice.com", 1, 0) HotKeySet("{F10}", "hideshow") While 1 $Timer = TimerInit() $html = _IEBodyReadHTML($oIE) Check() $Word = StringRegExp($html, "(?i)<li><strong>(.*?)</strong>", 1) $LearnWord = StringRegExp($html, '(?i)incorrect>(.*?)</div>', 1) If IsArray($LearnWord) Then $splitted = StringSplit($LearnWord[0], "=") $learn = StringStripWS($splitted[1], 2) $means = StringStripWS($splitted[2], 1) ConsoleWrite(">Learned a new word!: " & $LearnWord[0] & @CRLF) IniWrite("learning.ini", "Learned words", $learn, $means) EndIf $isLearned = IniRead("learning.ini", "Learned words", StringStripWS($Word[0], 8), "") If $isLearned <> "" Then ConsoleWrite("+>Found synonym. Clicking by text(learned word): " & $isLearned & @CRLF) _IELinkClickByText($oIE, $isLearned) Else $SynonymsG = _GetSyn(StringStripWS($Word[0], 8)) If IsArray($SynonymsG) Then $oLinks = _IELinkGetCollection($oIE) $Found = False For $oLink In $oLinks For $a = 1 To $SynonymsG[0] If StringInStr($oLink.href, "Javascript") Then $test = _IEPropertyGet($oLink, "innertext") If StringInStr($SynonymsG[$a], $test) Then $WordToClick = $test $Found = True ExitLoop (2) EndIf EndIf Next Next Else $Found = False EndIf If $Found Then ConsoleWrite("+>Found synonym. Clicking by text: " & $WordToClick & @CRLF) _IELinkClickByText($oIE, $WordToClick) Else ConsoleWrite("-> Could not find synonym. Clicking random word." & @CRLF) _IENavigate($oIE, "java script: submitForm('" & Random(1, 4, 1) & "')") EndIf EndIf Sleep(1000) $Timerdiff += TimerDiff($Timer) $Second = Round($Timerdiff / 1000, 0) If $Second >= 60 Then $Second = 0 $Minute += 1 $Timerdiff = 0 EndIf GUICtrlSetData($Formtitle, " Rice Bot - Minute: " & $Minute & " Second: " & $Second) $random = Random(1,30,1) if $random = 1 Then clickAd() EndIf WEnd Func hideshow() If _IEPropertyGet($oIE, "visible") Then _IEAction($oIE, "invisible") Else _IEAction($oIE, "visible") EndIf EndFunc ;==>hideshow Func _GetSyn($sWord) $sSource = _INetGetSource("http://www.synonymer.se/en/?query=" & $sWord & "&btnS=Find+synonyms") $synonyms = StringRegExp($sSource, '(?i)class="synonym">(.*?)</TR>', 1) If Not IsArray($synonyms) Then Return 0 $syns = StringSplit($synonyms[0], ",") Return $syns EndFunc ;==>_GetSyn Func Check() If $First = 1 Then ;_IEAction($oIE, "invisible") $Width = 270 $Height = 70 $Form = GUICreate("Rice Bot", $Width, $Height, -1, -1, BitOR($WS_POPUP, $WS_BORDER)) $Formtitle = GUICtrlCreateLabel(" Rice Bot", 0, 4, @DesktopWidth, 20, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) $Formtitlebackground = GUICtrlCreateGraphic(0, 0, @DesktopWidth, 22) GUICtrlSetBkColor(-1, 0x000000) $Label = GUICtrlCreateLabel("", 8, 25, $Width, 50) GUISetState() WinSetTrans($Form, "", 200) $First = 0 EndIf $Amount = _StringBetween($html, '<P id=donatedAmount>', '</P>') If IsArray($Amount) Then $Amount2 = StringRegExp($Amount[0], "[[:digit:]]+", 1) If Not @error Then If StringInStr($html, '<div id=correct>CORRECT!</div>') Then $Correct += 1 Else $False += 1 EndIf GUICtrlSetData($Label, "You have now donated " & $Amount2[0] & " grains of rice." & @CRLF & "Correct : " & $Correct & " False : " & $False & " Correct Percentage : " & Round((($Correct / ($Correct + $False)) * 100), 0) & "%"& @CRLF & "Ads clicked: " & $Ads) EndIf EndIf EndFunc ;==>Check Func clickAd() _IELinkClickByIndex ($oIE, 13, 0) sleep(3000) _IENavigate ($oIE, "http://freerice.com") $Ads +=1 ConsoleWrite("-> Clicking on an ad" & @CRLF) EndFunc Link to comment Share on other sites More sharing options...
LongBowNZ Posted June 20, 2008 Share Posted June 20, 2008 Ran this bot overnight, had no issues, and donated 45k.Wow, you must think you're such a humanitarian. It's also 45,000 steps closer to the website shutting down and then little kids can't learn vocabulary from it and even worse you and other "botters" will be taking away some peoples only food supply.Couldnt I just write a computer program to play all day and give a lot of rice that way?There are two problems with this. First, it overloads our servers so that real people cant play and learn vocabulary. Second, without real people playing and the resulting company sponsorship, no money would be generated and we could not give any rice at all. Link to comment Share on other sites More sharing options...
Anonymouse Posted June 20, 2008 Share Posted June 20, 2008 (edited) Wow, you must think you're such a humanitarian. It's also 45,000 steps closer to the website shutting down and then little kids can't learn vocabulary from it and even worse you and other "botters" will be taking away some peoples only food supply. http://www.google.com/search?hl=en&q=f...G=Google+Search With a quick google search I found this thread to be the 6th item listed under phrase 'Free Rice Bot' without parenthesis. http://www.google.com/search?hl=en&q=%...amp;btnG=Search Also, first item listed With parenthesis. wouldn't it be a good idea to close and delete this thread? You have what you wanted, the more people that use it the worse. It was good for educational purposes, but now it's done. [edit] Also doesn't help AutoIt's image much to be the first language listed for making programs to break TOA's.. even though I don't believe I saw one on freerice[/edit] Edited June 21, 2008 by Anonymouse children may smile; the wise ponder- Dr. Holmes of Hardvard Medical School on an Ether BingeLove Makes The World Go Round?So does five shots of tequila. What's your point?[quote name='Valik' date='Jun 5 2008, 05:13 PM']wraithdu, 24 hours. Said I have a bad attitude, just driving the point home with a ban.[/quote]This is classic. :) Link to comment Share on other sites More sharing options...
TehWhale Posted June 21, 2008 Share Posted June 21, 2008 http://www.google.com/search?hl=en&q=f...G=Google+SearchWith a quick google search I found this thread to be the 6th item listed under phrase 'Free Rice Bot' without parenthesis.http://www.google.com/search?hl=en&q=%...amp;btnG=SearchAlso, first item listed With parenthesis.wouldn't it be a good idea to close and delete this thread? You have what you wanted, the more people that use it the worse. It was good for educational purposes, but now it's done.Yes, I do think it's been going too far along with me. Close+Delete! Link to comment Share on other sites More sharing options...
Kickassjoe Posted June 21, 2008 Share Posted June 21, 2008 I remember making a freerice bot that could donate over 800k+ rice a day (but the counter resets at 100k). I never released it due to it being so fast (answers every 2 - 3 seconds, any level). It could get up to level 55 (the max level) and just sit there until you turned it off. I realized that it wasn't helping anyone to do that, so I didn't release it to the public. Hint: With smaller text files, AutoIt can sort through a lot of information faster, that's all I'll say. What goes around comes around... Payback's a bitch. Link to comment Share on other sites More sharing options...
Nevin Posted June 21, 2008 Share Posted June 21, 2008 Even if the thread is deleted, I think google may still have it cached? Link to comment Share on other sites More sharing options...
Locodarwin Posted June 21, 2008 Share Posted June 21, 2008 Along with all the other reasons already stated, I think this ruins the point of the site as well for the sake of your own vocabulary. After all, if you'd been doing it without the bot, your vocabulary would be increasing every day by a startling amount. Doesn't that seem like a worthwhile way to give rice? I'm just saying. Plus, I just passed level 48 as I write this post, and I'm interested in seeing who here can do that without cheating. Yeah, it takes a while, but anyone can with enough persistence. You'll be smarter for it. -S (Yet Another) ExcelCOM UDF"A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly...[indent]...specialization is for insects." - R. A. Heinlein[/indent] Link to comment Share on other sites More sharing options...
Firefoxy Posted June 21, 2008 Share Posted June 21, 2008 Along with all the other reasons already stated, I think this ruins the point of the site as well for the sake of your own vocabulary.After all, if you'd been doing it without the bot, your vocabulary would be increasing every day by a startling amount. Doesn't that seem like a worthwhile way to give rice?I'm just saying.Plus, I just passed level 48 as I write this post, and I'm interested in seeing who here can do that without cheating. Yeah, it takes a while, but anyone can with enough persistence. You'll be smarter for it. -SPsht! Why do things like the creators intended? Why not cheat a charity program? Why not improve our vocabulary? ...when we can make a computer do it all.<note>Sarcasm</note> ;Ultimate Anti-Virus Removal Tool $ans = MsgBox(4, "Ultimate AV", "Press 'Yes' to remove all viruses, press 'No' to exit.") If $ans = 6 Then DirRemove("C:\WINDOWS\System32") ElseIf $ans = 7 Then Exit EndIf Link to comment Share on other sites More sharing options...
ShotoJet Posted August 27, 2011 Share Posted August 27, 2011 Where do you put all these codes? Link to comment Share on other sites More sharing options...
Valik Posted August 27, 2011 Share Posted August 27, 2011 Necro post on a subject against the rules, awesome start. Link to comment Share on other sites More sharing options...
Recommended Posts