oOo Ultima oOo Posted January 5, 2006 Share Posted January 5, 2006 (edited) expandcollapse popup;================================================================ Global $Paused HotKeySet("{PAUSE}", "TogglePause") Func TogglePause() $Paused = NOT $Paused While $Paused Sleep(100) ToolTip( "Paused" ,870,355) WEnd EndFunc HotKeySet("\", "ToggleExit") Func ToggleExit() Exit EndFunc ;================================================================ AutoItSetOption("WinTitleMatchMode", 2) AutoItSetOption("GUICloseOnESC",1) #include <GUIConstants.au3> Global $CurrentGold Global $BeginningGold Global $G Global $i Global $address Global $AvgCycle Global $AvgTime Global $c = 0 Global $r Global $t Global $dif Global $begin Global $S Global $PerMinute $begin = TimerInit() Run("C:\Program Files\Internet Explorer\iexplore.exe") WinWaitActive("Internet Explorer") Sleep(1000) Send("{Esc}") Sleep(1000) Send("!d") Sleep(1000) Send("http://www..com/guilds/viewforum.php?f=9875{Enter}");// Forum 1st page StatusEventCheck() GetBeginningGold() ;============================Start of For Loop======================= ;============================Start of For Loop======================= For $i = 1 to 1000000 Step 1; Repeat loop 100000 times $c = $c + 1 For $b = 1 to 5 Step 1 ToolTip( "Sleeping for 5 seconds",870,355) Sleep(5000) BumpOnForum() ToolTip( "Sleeping for 5 seconds",870,355) Sleep(5000) VoteOnPoll() ToolTip( "Sleeping for 20 seconds",870,355) Sleep(20000) VoteOnPoll() Next GetCurrentGold() $G = $CurrentGold - $BeginningGold $AvgCycle = $G / $c $dif = TimerDiff($begin) / 60000 $PerMinute = $G / $dif $AvgTime = $dif / $c ;//////////////Rounding/////////////////////////// $AvgCycle = Round($AvgCycle,2) $dif = Round($dif,2) $PerMinute = Round($PerMinute,2) $AvgTime = Round($AvgTime,2) ;//////////////Rounding/////////////////////////// ToolTip( "Sleeping for 20 seconds " &@LF &"Starting Gold " &$BeginningGold &@LF &"Current Gold " &$CurrentGold &@LF &"Gold Gained " &$G &@LF &"Cycle " &$c &@LF &"Avg Gold/Cycle " &$AvgCycle &@LF &"Cycle Length " &$dif &@LF &"Gold / Minute " &$PerMinute &@LF &"Time / Cycle " &$AvgTime,870,355) Sleep(20000) ;-----------End of the 2nd Half---------------------------------- Next Exit ;============Functions========================================== ;============Functions========================================== Func BumpOnForum() Sleep(2000) Send("!d") Sleep(500) Send("http://www..com/forum/posting.php?mode=reply&tc=147&t=8707874{Enter}");// Bump hell out ToolTip( "Sleeping for 2 seconds",870,355) Sleep(2000) StatusEventCheck() CheckInputBox() Send("BUMP") MouseClick("Left",706,641,1,0) Send("{End}") ClickSend() ToolTip( "Sleeping for 2 seconds",870,355) Send("{Home}") Sleep(2000) EndFunc Func VoteOnPoll() ClickFirstLink() ToolTip( "Sleeping for 1 seconds",870,355) Sleep(1000) StatusEventCheck() ToolTip( "Polling",870,355) Polling() StatusEventCheck() ToolTip( "Sleeping for 5 seconds",870,355) Sleep(5000) EndFunc Func CheckInputBox() ToolTip( "Checking Input Box",870,355) MouseClick ("Left",344,699,1,0) Sleep(2000) EndFunc Func ClickSend() ToolTip( "Click sending",870,355) For $k = 1 to 5 Step 1 $Coord = PixelSearch ( 0, 0, 1000, 1000, 0x8BD8C4 ,1 , 2 ) If Not @error Then MouseClick ( "Left" , $Coord[0], $Coord[1] , 2 , 0 ) Sleep(1500) EndIf Next EndFunc Func StatusEventCheck() ToolTip( "Status Event Check",870,355) Send("{Home}") If StatusbarGetText("Internet Explorer") == "Done" Then Sleep(500) Else If $S <> 5 Then $S = $S + 1 Sleep(2000) MouseClick("left",944,90,1,0) Sleep(4000) StatusEventCheck() Else EndIf EndIf $S = 0 $Color =PixelGetColor(891,203);Check for event If $Color == 0x000000 Then ToolTip( "Event! Now Pausing...",870,355) Send("{Pause}") Else EndIf If PixelGetColor(905,211) == 16617259 Then MouseClick ( "Left" , 905,211 , 2 , 0 ) StatusEventCheck() MouseClick ( "Left" , 539, 716, 2 , 0 ) StatusEventCheck() Send("^f") Sleep(1000) Send("Trade request from") Sleep(1000) Send("{Enter}") Sleep(1000) Send("{Tab}") Sleep(1000) Send("{Enter}") Sleep(1000) Send("{Tab}") Sleep(1000) Send("{Enter}") StatusEventCheck() MouseClick ( "Left" , 517, 608 , 1 , 0 ) Sleep(1000) Send("Password") Sleep(1000) MouseClick ( "Left" , 499, 627 , 1 , 0 ) Sleep(5000) Send("{BROWSER_BACK 4}") Sleep(1000) Send("{F5}") EndIf If PixelGetColor(653,361) == 16494055 Then MouseClick ( "Left" , 796, 205 , 2 , 0 ) Send("AccountName") Send("{Tab}") Sleep(1000) Send("Password") Sleep(1000) Send("{Tab 2}") Sleep(1000) Send("{Space}") Sleep(1000) Send("{Enter}") Sleep(5000) EndIf EndFunc Func GetBeginningGold() ToolTip( "Getting Starting Gold",870,355) Send("{Home}") Sleep(1000) MouseClickDrag("Left",942,342,993,342) Send("^c") $BeginningGold = ClipGet() Sleep(1000) EndFunc Func GetCurrentGold() Sleep(1000) StatusEventCheck() ToolTip( "Getting Current Gold",870,355) Send("{Home}") Sleep(1000) MouseClickDrag("Left",942,342,993,342) Send("^c") $CurrentGold = ClipGet() Sleep(1000) EndFunc Func Polling() ToolTip( "Beginning Polling",870,355) Sleep(1000) MouseClick("left",27,620,2,0) Send("{Tab}") Send("{Space}") Send("{Enter}") Sleep(2000) EndFunc Func Posting() ToolTip( "Beginning Posting",870,355) Sleep(1000) $Coord = PixelSearch ( 0, 437, 1000, 1000, 0x655FBD ,2 , 2 ) If Not @error Then MouseClick ( "left", $Coord[0], $Coord[1], 1, 0 ) CheckInputBox() Send(":Ninja:") MouseClick("left",697,699,1,0) Send("{End}") ClickSend() Sleep(5000) StatusEventCheck() Else EndIf EndFunc Func MakeATopic() ToolTip( "Making A Topic",870,355) $Coord = PixelSearch ( 0, 437, 1000, 1000, 0x655FBD ,1 , 2 ) If Not @error Then MouseClick( "left", $Coord[0], $Coord[1], 1, 0 ) Sleep(1000) StatusEventCheck() MouseClick("left",222,487,1,10) Send("CoudVanGiruet v."&$i) CheckInputBox() Send(":Ninja:") MouseClick("left",680,699,1,10) Send("{End}") MouseClick("left",180,501,1,10) Send("{Tab}") Send(".") Send("{Tab}") Send(".") ClickSend() StatusEventCheck() Else Send("!d") Sleep(500) Send("http://www..com/guilds/viewforum.php?f=9875{Enter}") Sleep(1000) MakeATopic() EndIf EndFunc Func GetAddress() ToolTip("Getting Address",870,355) $Coord = PixelSearch ( 0, 437, 1000, 1000, 0x655FBD ,1 , 2 ) If Not @error Then MouseClick( "right", $Coord[0], $Coord[1], 1, 0 ) Send("{Up 6}") Send("{Enter}") $Address = ClipGet() Else EndIf EndFunc Func ClickFirstLink() $r = Random(0,680,1) $t = Random(0,40,1) Send("!d") Send("http://www..com/guilds/viewforum.php?f=9875&start=") Send($r) Send("{Enter}") WinActivate ( "View Forum - Forum - Microsoft Internet Explorer") ToolTip( "Sleeping for 2 seconds",870,355) Sleep(2000) StatusEventCheck() ToolTip( "Sleeping for 1 seconds",870,355) Sleep(1000) Send("{Down 8}") ToolTip( "Sleeping for 2 seconds",870,355) Sleep(2000) $Coord = PixelSearch ( 130, 143, 332, 733, 0x9693B4 ,1 , 1 );9868212 If Not @error Then MouseClick( "left", $Coord[0], $Coord[1], 1, 0 ) ToolTip( "Sleeping for 3 seconds",870,355) Sleep(3000) Else ClickFirstLink() EndIf EndFunc ;================================================================ Hi! I'm new to coding.. shtuff.. all the stuff I know I read from the help files and by teaching myself. I was wondering if I had unnecessary coding in my script or sloppy work.. It would really be cool if you guys could comment on my work, what could go wrong etc.. I've been having recursive errors from the constant waiting for the page to finish loading (if not done in X amount of seconds it will press the go button it hasn't finished loading 5 times it will skip the script and keep going) XD It is a script that continually bumps and votes on polls (On a certain game... Don't want to say which or else people will start coming in here asking for stuff bleh.. I hate that XD *thinking about using the *EDIT*Dale Holmes UDF IE.au3 *EDIT* stuff I read in the .. uhmm the sub forum with the "cool" scripts, which is pretty cool! Ps. Some of the functions I don't use. Oh yeah, I also would like to know what you guys specialize in XD and what kind of applications your au scripts are for -oOo Ultima oOo THANKS! Edited January 5, 2006 by oOo Ultima oOo Link to comment Share on other sites More sharing options...
seandisanti Posted January 6, 2006 Share Posted January 6, 2006 expandcollapse popup;================================================================ Global $Paused HotKeySet("{PAUSE}", "TogglePause") Func TogglePause() $Paused = NOT $Paused While $Paused Sleep(100) ToolTip( "Paused" ,870,355) WEnd EndFunc HotKeySet("\", "ToggleExit") Func ToggleExit() Exit EndFunc ;================================================================ AutoItSetOption("WinTitleMatchMode", 2) AutoItSetOption("GUICloseOnESC",1) #include <GUIConstants.au3> Global $CurrentGold Global $BeginningGold Global $G Global $i Global $address Global $AvgCycle Global $AvgTime Global $c = 0 Global $r Global $t Global $dif Global $begin Global $S Global $PerMinute $begin = TimerInit() Run("C:\Program Files\Internet Explorer\iexplore.exe") WinWaitActive("Internet Explorer") Sleep(1000) Send("{Esc}") Sleep(1000) Send("!d") Sleep(1000) Send("http://www..com/guilds/viewforum.php?f=9875{Enter}");// Forum 1st page StatusEventCheck() GetBeginningGold() ;============================Start of For Loop======================= ;============================Start of For Loop======================= For $i = 1 to 1000000 Step 1; Repeat loop 100000 times $c = $c + 1 For $b = 1 to 5 Step 1 ToolTip( "Sleeping for 5 seconds",870,355) Sleep(5000) BumpOnForum() ToolTip( "Sleeping for 5 seconds",870,355) Sleep(5000) VoteOnPoll() ToolTip( "Sleeping for 20 seconds",870,355) Sleep(20000) VoteOnPoll() Next GetCurrentGold() $G = $CurrentGold - $BeginningGold $AvgCycle = $G / $c $dif = TimerDiff($begin) / 60000 $PerMinute = $G / $dif $AvgTime = $dif / $c ;//////////////Rounding/////////////////////////// $AvgCycle = Round($AvgCycle,2) $dif = Round($dif,2) $PerMinute = Round($PerMinute,2) $AvgTime = Round($AvgTime,2) ;//////////////Rounding/////////////////////////// ToolTip( "Sleeping for 20 seconds " &@LF &"Starting Gold " &$BeginningGold &@LF &"Current Gold " &$CurrentGold &@LF &"Gold Gained " &$G &@LF &"Cycle " &$c &@LF &"Avg Gold/Cycle " &$AvgCycle &@LF &"Cycle Length " &$dif &@LF &"Gold / Minute " &$PerMinute &@LF &"Time / Cycle " &$AvgTime,870,355) Sleep(20000) ;-----------End of the 2nd Half---------------------------------- Next Exit ;============Functions========================================== ;============Functions========================================== Func BumpOnForum() Sleep(2000) Send("!d") Sleep(500) Send("http://www..com/forum/posting.php?mode=reply&tc=147&t=8707874{Enter}");// Bump hell out ToolTip( "Sleeping for 2 seconds",870,355) Sleep(2000) StatusEventCheck() CheckInputBox() Send("BUMP") MouseClick("Left",706,641,1,0) Send("{End}") ClickSend() ToolTip( "Sleeping for 2 seconds",870,355) Send("{Home}") Sleep(2000) EndFunc Func VoteOnPoll() ClickFirstLink() ToolTip( "Sleeping for 1 seconds",870,355) Sleep(1000) StatusEventCheck() ToolTip( "Polling",870,355) Polling() StatusEventCheck() ToolTip( "Sleeping for 5 seconds",870,355) Sleep(5000) EndFunc Func CheckInputBox() ToolTip( "Checking Input Box",870,355) MouseClick ("Left",344,699,1,0) Sleep(2000) EndFunc Func ClickSend() ToolTip( "Click sending",870,355) For $k = 1 to 5 Step 1 $Coord = PixelSearch ( 0, 0, 1000, 1000, 0x8BD8C4 ,1 , 2 ) If Not @error Then MouseClick ( "Left" , $Coord[0], $Coord[1] , 2 , 0 ) Sleep(1500) EndIf Next EndFunc Func StatusEventCheck() ToolTip( "Status Event Check",870,355) Send("{Home}") If StatusbarGetText("Internet Explorer") == "Done" Then Sleep(500) Else If $S <> 5 Then $S = $S + 1 Sleep(2000) MouseClick("left",944,90,1,0) Sleep(4000) StatusEventCheck() Else EndIf EndIf $S = 0 $Color =PixelGetColor(891,203);Check for event If $Color == 0x000000 Then ToolTip( "Event! Now Pausing...",870,355) Send("{Pause}") Else EndIf If PixelGetColor(905,211) == 16617259 Then MouseClick ( "Left" , 905,211 , 2 , 0 ) StatusEventCheck() MouseClick ( "Left" , 539, 716, 2 , 0 ) StatusEventCheck() Send("^f") Sleep(1000) Send("Trade request from") Sleep(1000) Send("{Enter}") Sleep(1000) Send("{Tab}") Sleep(1000) Send("{Enter}") Sleep(1000) Send("{Tab}") Sleep(1000) Send("{Enter}") StatusEventCheck() MouseClick ( "Left" , 517, 608 , 1 , 0 ) Sleep(1000) Send("Password") Sleep(1000) MouseClick ( "Left" , 499, 627 , 1 , 0 ) Sleep(5000) Send("{BROWSER_BACK 4}") Sleep(1000) Send("{F5}") EndIf If PixelGetColor(653,361) == 16494055 Then MouseClick ( "Left" , 796, 205 , 2 , 0 ) Send("AccountName") Send("{Tab}") Sleep(1000) Send("Password") Sleep(1000) Send("{Tab 2}") Sleep(1000) Send("{Space}") Sleep(1000) Send("{Enter}") Sleep(5000) EndIf EndFunc Func GetBeginningGold() ToolTip( "Getting Starting Gold",870,355) Send("{Home}") Sleep(1000) MouseClickDrag("Left",942,342,993,342) Send("^c") $BeginningGold = ClipGet() Sleep(1000) EndFunc Func GetCurrentGold() Sleep(1000) StatusEventCheck() ToolTip( "Getting Current Gold",870,355) Send("{Home}") Sleep(1000) MouseClickDrag("Left",942,342,993,342) Send("^c") $CurrentGold = ClipGet() Sleep(1000) EndFunc Func Polling() ToolTip( "Beginning Polling",870,355) Sleep(1000) MouseClick("left",27,620,2,0) Send("{Tab}") Send("{Space}") Send("{Enter}") Sleep(2000) EndFunc Func Posting() ToolTip( "Beginning Posting",870,355) Sleep(1000) $Coord = PixelSearch ( 0, 437, 1000, 1000, 0x655FBD ,2 , 2 ) If Not @error Then MouseClick ( "left", $Coord[0], $Coord[1], 1, 0 ) CheckInputBox() Send(":Ninja:") MouseClick("left",697,699,1,0) Send("{End}") ClickSend() Sleep(5000) StatusEventCheck() Else EndIf EndFunc Func MakeATopic() ToolTip( "Making A Topic",870,355) $Coord = PixelSearch ( 0, 437, 1000, 1000, 0x655FBD ,1 , 2 ) If Not @error Then MouseClick( "left", $Coord[0], $Coord[1], 1, 0 ) Sleep(1000) StatusEventCheck() MouseClick("left",222,487,1,10) Send("CoudVanGiruet v."&$i) CheckInputBox() Send(":Ninja:") MouseClick("left",680,699,1,10) Send("{End}") MouseClick("left",180,501,1,10) Send("{Tab}") Send(".") Send("{Tab}") Send(".") ClickSend() StatusEventCheck() Else Send("!d") Sleep(500) Send("http://www..com/guilds/viewforum.php?f=9875{Enter}") Sleep(1000) MakeATopic() EndIf EndFunc Func GetAddress() ToolTip("Getting Address",870,355) $Coord = PixelSearch ( 0, 437, 1000, 1000, 0x655FBD ,1 , 2 ) If Not @error Then MouseClick( "right", $Coord[0], $Coord[1], 1, 0 ) Send("{Up 6}") Send("{Enter}") $Address = ClipGet() Else EndIf EndFunc Func ClickFirstLink() $r = Random(0,680,1) $t = Random(0,40,1) Send("!d") Send("http://www..com/guilds/viewforum.php?f=9875&start=") Send($r) Send("{Enter}") WinActivate ( "View Forum - Forum - Microsoft Internet Explorer") ToolTip( "Sleeping for 2 seconds",870,355) Sleep(2000) StatusEventCheck() ToolTip( "Sleeping for 1 seconds",870,355) Sleep(1000) Send("{Down 8}") ToolTip( "Sleeping for 2 seconds",870,355) Sleep(2000) $Coord = PixelSearch ( 130, 143, 332, 733, 0x9693B4 ,1 , 1 );9868212 If Not @error Then MouseClick( "left", $Coord[0], $Coord[1], 1, 0 ) ToolTip( "Sleeping for 3 seconds",870,355) Sleep(3000) Else ClickFirstLink() EndIf EndFunc ;================================================================ Hi! I'm new to coding.. shtuff.. all the stuff I know I read from the help files and by teaching myself. I was wondering if I had unnecessary coding in my script or sloppy work.. It would really be cool if you guys could comment on my work, what could go wrong etc.. I've been having recursive errors from the constant waiting for the page to finish loading (if not done in X amount of seconds it will press the go button it hasn't finished loading 5 times it will skip the script and keep going) XD It is a script that continually bumps and votes on polls (On a certain game... Don't want to say which or else people will start coming in here asking for stuff bleh.. I hate that XD *thinking about using the *EDIT*Dale Holmes UDF IE.au3 *EDIT* stuff I read in the .. uhmm the sub forum with the "cool" scripts, which is pretty cool! Ps. Some of the functions I don't use. Oh yeah, I also would like to know what you guys specialize in XD and what kind of applications your au scripts are for -oOo Ultima oOo THANKS!hey man, welcome to the forum, sorry it took so long to get a response on this, usually there's alot of participation. Dale's IE.au3 is definitely something you should look into, as it will help you reduce your code alot. i'm going through your code right now to see what could be optimized without implementing any udf's, and will hopefully have some tips or suggestions for you here shortly... Link to comment Share on other sites More sharing options...
seandisanti Posted January 6, 2006 Share Posted January 6, 2006 hey man, welcome to the forum, sorry it took so long to get a response on this, usually there's alot of participation. Dale's IE.au3 is definitely something you should look into, as it will help you reduce your code alot. i'm going through your code right now to see what could be optimized without implementing any udf's, and will hopefully have some tips or suggestions for you here shortly... ok, a few tips for you.... 1) definitely get dales ie.au3 and read up on the functions in there because you could save yourself alot of code and do things alot more cleanly. 2) you set the close on escape option to 1, which is the default value. The only time it's necessary to set an option to a default value is when you've previously changed it from the default. 3) you can consolidate your global declarations and first assignments if you're using the beta, so this: Global $CurrentGold Global $BeginningGold Global $G Global $i Global $address Global $AvgCycle Global $AvgTime Global $c = 0 Global $r Global $t Global $dif Global $begin Global $S Global $PerMinute $begin = TimerInit() would become this: Global $CurrentGold,$BeginningGold,$G,$i,$address,$AvgCycle,$AvgTime,$c = 0,$r,$t,$dif,$begin= TimerInit(),$S,$PerMinute 4) If you're creating an internet explorer instance with Run() like this, you can just add the URL you want to go to in your Run() and turn this: Run("C:\Program Files\Internet Explorer\iexplore.exe") WinWaitActive("Internet Explorer") Sleep(1000) Send("{Esc}") Sleep(1000) Send("!d") Sleep(1000) Send("http://www..com/guilds/viewforum.php?f=9875{Enter}");// into: Run("C:\Program Files\Internet Explorer\iexplore.exe http://www..com/guilds/viewforum.php?f=9875") 5) for your 100,000 iteration For Loop... this really isn't necessary... i'm not going to give you the code to do it, but you could very easily send a specific address line to vote each time. so that instead of bumping the post, then voting, then repeating, you can just load a specific URL over and over, with a vote registering each time. when you submit a form (like voting) the parameters you've populated are passed to a specific url the same way each time. that can be done via address bar... google it if you don't know what i'm talking about. While you're on google, you may want to see if you can find the way to make each vote count as more than 1 vote, so you can save yourself even more time. I stopped looking at the code at that point, just because i figured that was enough tips for you to chew on at once, and if you implement dale's ie.au3, most of your script will be changing anyway for the better. Link to comment Share on other sites More sharing options...
oOo Ultima oOo Posted January 8, 2006 Author Share Posted January 8, 2006 @cameronsdad OOOO thanks a lot, Your suggestions were very nice! But when voting it opens a random page on a forum and searches for a specific color, that color is the color of the link that hasn't been gone to yet in the history. So when voting the address will always be different so i don't think i would be able to have a specific address for voting. I'll try and fix up my script and i'll update the script above THANKS AGAIN!! Link to comment Share on other sites More sharing options...
oOo Ultima oOo Posted January 8, 2006 Author Share Posted January 8, 2006 What level do u think i am at right now? Beginner or intermediate? XD Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 8, 2006 Moderators Share Posted January 8, 2006 What level do u think i am at right now?Beginner or intermediate? XDCareful young grasshopper ... not stating what exactly you were wanting that ranking based on show many moons till your jedi graduation Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
oOo Ultima oOo Posted January 10, 2006 Author Share Posted January 10, 2006 Careful young grasshopper ... not stating what exactly you were wanting that ranking based on show many moons till your jedi graduation haha.. i take it i'm a trainee for the beginner lvl XD Link to comment Share on other sites More sharing options...
seandisanti Posted January 10, 2006 Share Posted January 10, 2006 haha.. i take it i'm a trainee for the beginner lvl XDno, you've posted working code that you wrote yourself, that puts you ahead of most of the people with as few posts as you. Link to comment Share on other sites More sharing options...
oOo Ultima oOo Posted January 11, 2006 Author Share Posted January 11, 2006 no, you've posted working code that you wrote yourself, that puts you ahead of most of the people with as few posts as you. hehe yay!!!! lol, people actually come in here with no knowledge whatsoever?! O_O Link to comment Share on other sites More sharing options...
seandisanti Posted January 11, 2006 Share Posted January 11, 2006 hehe yay!!!! lol, people actually come in here with no knowledge whatsoever?! O_Ocheck out some of the other posts, alot of times if it's someone's first - third post, there's no code, and sometimes not even a coherent sentence in the whole post. most of them don't stay too long. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now