Sign in to follow this  
Followers 0
thats5

How to make it login if it disconnects?

13 posts in this topic

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:

CODE
HotKeySet("{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 :)

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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.jpg

As 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 out

how you guys actually get the pixel...

If you could help me out, I'll give ya a cookie if I ever meet you :)

Share this post


Link to post
Share on other sites

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.jpg

As 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 out

how 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 name

send tabs to focus the connect button (i dont know if tab is suitable and how many)

send enter key

what do you think? o:)

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]

Share this post


Link to post
Share on other sites

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 ^^

Share this post


Link to post
Share on other sites

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 :)

Share this post


Link to post
Share on other sites

Could you write me how that would look? The script I mean :) My dad maybe understands you better than I do ..

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

sorry, i really can't write if for you

i lack the time & motivation to do it :))

i can, however, provide you with some more in-depth tips

http://img146.imageshack.us/my.php?image=blablakh0.jpg

as you can see, i have highlighted an area in the attached image

if my logic serves me correct, that image will only look like that when you are not connected

in 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 line

while pixelchecksum(left,top,right,bottom) = "value"

mouseclick(left, x, y) ;x,y = the coords of a pixel on the connect button

wend

this 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 by mc83

Share this post


Link to post
Share on other sites

Could someone please show me an example? Like how do I get coords for the pixelchecksum()

It would help me alot..

Share this post


Link to post
Share on other sites

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 HOME

WEnd

While PixelChecksum(266,306,511,397) = "value" ; Value?

mouseclick("369,377,1,10)

Sleep("230")

Mouseclick("left",469,377,1,10)

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

Could someone explain more?

while pixelchecksum(left,top,right,bottom) = "value"

What shall the "value" be?

Share this post


Link to post
Share on other sites

Ahh, finally! I made it :) And now I have taught me another new thingy, thanks people. The script is done and looks like this:

CODE
HotKeySet("{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?

Share this post


Link to post
Share on other sites

#13 ·  Posted (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 by nyxx24

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0