thats5 Posted November 26, 2008 Posted November 26, 2008 Hey everyone, I have made my first script (REALLY simple) but It works good, exept for one thing. First it Cut some logs, then fletches them.. And repeat. How can I make so if it disconnects it will try to reconnect lets say.. Every 30sec. Any help would be greatly appreciated! Here's the script: CODEHotKeySet("{HOME}","StartScript") HotKeySet("{END}","StopScript") While 1 sleep("10000"); Idle, will start when you press HOME WEnd Func StartScript() While 1 MouseClick("left",283,242,1,10) sleep("56000") ;Waits untill you have cutted enough logs Mouseclick("Right",589,348,1,10) sleep("33") MouseClick("Left",584,386,1,10) sleep("53");Drops a log MouseClick("Left",590,311,1,10) sleep("43") mouseclick("left",671,313,1,10) sleep("40000");Waits until you have fletched WEnd EndFunc Func StopScript() Exit EndFunc I know this is waay to simple for you pro's but please, help a fellow "programmer" out
nyxx24 Posted November 27, 2008 Posted November 27, 2008 Hello First I am by far an amatuer and may be completely wrong.. but I think it would help to state what game this is for so people familiar with that game and it's login process might be able to help you.. Second if it were me (probably doing it the hard way) I think I might try to find a way to: Use script writer to write a simple script to load the game Then find a section of the screen whose color remains constant while logged in but changes when the game disconnects Then using that, use a pixel search and maybe an if then statement in the loop to run the section of code to load the game or skip it if the game is still running.. Just a thought to give you some ideas maybe and I couldn't tell you how to do it all still learning myself but the help file & search are very helpful Good luck Nyxx
thats5 Posted November 27, 2008 Author Posted November 27, 2008 Okay, the game is Runescape (misthalin.com private server) I'm mostly playing it just to learn Here is a picture of the login screen.. If that would help you to help me http://img293.imageshack.us/img293/7024/helpautoitplzhc4.jpgAs written in there, I just need the bot to press "Connect" to login. Like every 30sec until its inside.. Any help?I know NOTHING about PixelSearch etc.. I've searched the forum but still haven't found outhow you guys actually get the pixel...If you could help me out, I'll give ya a cookie if I ever meet you
November Posted November 27, 2008 Posted November 27, 2008 Okay, the game is Runescape (misthalin.com private server) I'm mostly playing it just to learn Here is a picture of the login screen.. If that would help you to help me http://img293.imageshack.us/img293/7024/helpautoitplzhc4.jpgAs written in there, I just need the bot to press "Connect" to login. Like every 30sec until its inside.. Any help?I know NOTHING about PixelSearch etc.. I've searched the forum but still haven't found outhow you guys actually get the pixel...If you could help me out, I'll give ya a cookie if I ever meet you Hi there,Here's the plan...get window namesend tabs to focus the connect button (i dont know if tab is suitable and how many)send enter keywhat do you think? Cheers Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font]
thats5 Posted November 27, 2008 Author Posted November 27, 2008 Sorry I'm such a complete noob but ... Get Window name, means the name of the window? It's Mozilla Firefox if so. Send tabs to focus the connect button, didn't understand anything of that send enter key, the thing is that Enter doesen't make you login, you have to press with Mouse.. But that will be the same I guess ^^
mc83 Posted November 27, 2008 Posted November 27, 2008 hi mate just do a pixelchecksum() of the area where the login screen appears before sending the actual clicks. do an if then against the checksum, if it turns out the login screen is there, click the button simple as that
thats5 Posted November 27, 2008 Author Posted November 27, 2008 Could you write me how that would look? The script I mean My dad maybe understands you better than I do ..
mc83 Posted November 27, 2008 Posted November 27, 2008 (edited) sorry, i really can't write if for youi lack the time & motivation to do it )i can, however, provide you with some more in-depth tipshttp://img146.imageshack.us/my.php?image=blablakh0.jpgas you can see, i have highlighted an area in the attached imageif my logic serves me correct, that image will only look like that when you are not connectedin your While loop, prior to calling the StartScript function, add another while statement (i said if-then at first, but i just changed my mind)something linewhile pixelchecksum(left,top,right,bottom) = "value" mouseclick(left, x, y) ;x,y = the coords of a pixel on the connect buttonwendthis will click the connect button until the checksum of the highlighted area no longer equals "value"go read the manual for pixelchecksum(), figure out how it works and it will all seem so much easier good luck Edited November 27, 2008 by mc83
thats5 Posted November 28, 2008 Author Posted November 28, 2008 Could someone please show me an example? Like how do I get coords for the pixelchecksum() It would help me alot..
thats5 Posted November 28, 2008 Author Posted November 28, 2008 I've added so it looks like this (not completed cause I don't really understand)HotKeySet("{HOME}","StartScript")HotKeySet("{END}","StopScript")PixelChecksum(266,306,511,397)While 1 sleep("10000"); Idle, will start when you press HOMEWEndWhile PixelChecksum(266,306,511,397) = "value" ; Value?mouseclick("369,377,1,10)Sleep("230")Mouseclick("left",469,377,1,10)wendFunc StartScript() While 1 MouseClick("left",283,242,1,10) sleep("56000") ;Waits untill you have cutted enough logs Mouseclick("Right",589,348,1,10) sleep("33") MouseClick("Left",584,386,1,10) sleep("53");Drops a log MouseClick("Left",590,311,1,10) sleep("43") mouseclick("left",671,313,1,10) sleep("40000");Waits until you have fletched WEndEndFuncFunc StopScript() Exit EndFunc Could someone explain more?while pixelchecksum(left,top,right,bottom) = "value"What shall the "value" be?
thats5 Posted November 30, 2008 Author Posted November 30, 2008 Ahh, finally! I made it And now I have taught me another new thingy, thanks people. The script is done and looks like this: CODEHotKeySet("{HOME}","StartScript") HotKeySet("{END}","StopScript") While 1 sleep("10000"); Idle, will start when you press HOME WEnd Func StartScript() While 1 LoggedOut() MouseClick("left",283,242,1,10) LoggedOut() sleep("6000") LoggedOut() sleep("10000") LoggedOut() sleep("20000") LoggedOut() Sleep("15000") LoggedOut() Sleep("9000") LoggedOut() Sleep("6000") LoggedOut() Mouseclick("Right",589,348,1,10) LoggedOut() sleep("33") MouseClick("Left",584,386,1,10) LoggedOut() sleep("53");Drops a log MouseClick("Left",590,311,1,10) LoggedOut() sleep("43") mouseclick("left",671,313,1,10) LoggedOut() sleep("5000") LoggedOut() sleep("5000") LoggedOut() sleep("5000") LoggedOut() sleep("5000") LoggedOut() sleep("5000") LoggedOut() sleep("5000") LoggedOut() sleep("5000") LoggedOut() sleep("5000") LoggedOut() WEnd EndFunc Func StopScript() Exit EndFunc Func LoggedOut() If PixelChecksum(680,427,740,447) = 1222663559 Then MouseClick("left",474,374,1,10) sleep("230") MouseClick("left",316,401,1,10) sleep("8938") EndIf EndFunc Quite simple when you have done it, eh?
nyxx24 Posted December 5, 2008 Posted December 5, 2008 (edited) Hey Mate, Looks like you did it, I was thinking about trying it myself but havent done so yet.. So if I understand what you achieved correctly.. Anywhere you put: Func LoggedOut() Runs this: Func LoggedOut() If PixelChecksum(680,427,740,447) = 1222663559 Then MouseClick("left",474,374,1,10) sleep("230") MouseClick("left",316,401,1,10) sleep("8938") EndIf EndFunc Which checks for the certain pixel that is present only when logged off and if found logs back on then continues, and if not found it does nothing and the script continues.. right? I remember I mentioned pixel search earlier whats the difference between using pixel search to check the pixel color and pixel checksum? Is one better than the other? Edited December 5, 2008 by nyxx24
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