SRL Archive - OSR Help

Logging Out and In.


Example

2012-04-09 06:39:04

Currently making my first script although its not for RuneScape but one of the many Private Servers i play. Really enjoying it so far, scripting im talking about. Script is working perfectly, so far its thieves and Alchs not a lot but its a start.

Right now im looking to add some code that will log out and back in as a random on the server is it asks you a question which you need to answer, simply logging in and out gets rid of it.


Any suggestions?

Example

2012-04-09 11:13:16

Anyone? Im guessing the logging and out will be quite simple but the eating im not sure about

Dgby714

2012-04-09 11:16:38

idk about eating


function LoggedIn: boolean;
procedure LoginPlayer;
procedure Logout;

Example

2012-04-09 11:24:08

From: Dgby714
idk about eating


function LoggedIn: boolean;
procedure LoginPlayer;
procedure Logout;


Think i did the eating, be quite pleased if it does work as i worked it out on my own

this is what i got for eating but for some reason im getting an Error. Right at the end of my script the "end;" is where the error is showing but i cant figure it out.


//Eating

procedure Eat;
begin
if(FindColor(x,y,Hit,8,5,516,333)) then
begin
if(FindColor(x,y,Sword,564,214,726,451)) then
begin
wait(300);
ClickMouse(x,y,mouse_Left);
wait(randomrange(500,700));

end;
end;


//Main Loop


Begin
repeat

Steal;
Alch;
Eat;

until(false);
end; //Error is showing here.

Dgby714

2012-04-09 11:30:06

The main begin end has a period (.) after end not a semi-colon [noparse](;)[/noparse]

program _;
begin
end.

Failure

2012-04-09 11:32:55

From: Example
Think i did the eating, be quite pleased if it does work as i worked it out on my own

this is what i got for eating but for some reason im getting an Error. Right at the end of my script the "end;" is where the error is showing but i cant figure it out.


//Eating

procedure Eat;
begin
if(FindColor(x,y,Hit,8,5,516,333)) then
begin
if(FindColor(x,y,Sword,564,214,726,451)) then
begin
wait(300);
ClickMouse(x,y,mouse_Left);
wait(randomrange(500,700));

end;
end;


//Main Loop


Begin
repeat

Steal;
Alch;
Eat;

until(false);
end; //Error is showing here.


//Eating

procedure Eat;
begin // 1 Begin
if(FindColor(x,y,Hit,8,5,516,333)) then
begin // 2 Begin
if(FindColor(x,y,Sword,564,214,726,451)) then
begin // 3 Begin
wait(300);
ClickMouse(x,y,mouse_Left);
wait(randomrange(500,700));

End;
End; // Two ends?
End; //Added third end.


//Main Loop


Begin
repeat

Steal;
Alch;
Eat;

until(false);
end. //Error is showing here.
//Mainloop ends with end. with a dot, nor a semicolom.

Example

2012-04-09 11:35:00

From: Failure
//Eating

procedure Eat;
begin // 1 Begin
if(FindColor(x,y,Hit,8,5,516,333)) then
begin // 2 Begin
if(FindColor(x,y,Sword,564,214,726,451)) then
begin // 3 Begin
wait(300);
ClickMouse(x,y,mouse_Left);
wait(randomrange(500,700));

End;
End; // Two ends?
End; //Added third end.


//Main Loop


Begin
repeat

Steal;
Alch;
Eat;

until(false);
end; //Error is showing here.


Yeah just found out the problem, like you say was missing one more "end;" Almost had it :duh:

Failure

2012-04-09 11:38:21

From: Example
Yeah just found out the problem, like you say was missing one more "end;" Almost had it :duh:


Also the dot at the last line of end, since it has to end your mainloop.

Example

2012-04-09 11:41:47


//Eating

procedure Eat;
begin
if(FindColor(x,y,Hit,8,5,516,333)) then //Finds the colour red when your Attacked
begin
if(FindColor(x,y,Sword,564,214,726,451)) then //Finds Swordfish in Inv
begin
wait(300);
ClickMouse(x,y,mouse_Left); //Eat
wait(randomrange(500,700));

end;
end;
end;

But its not eating for some reason.

Abu

2012-04-09 11:46:08

Use better colors or maybe even make a DTM for the food you want to eat.

What is is that you want to eat exactly?

Failure

2012-04-09 11:46:42

From: Example

//Eating

procedure Eat;
begin
if(FindColor(x,y,Hit,8,5,516,333)) then //Finds the colour red when your Attacked
begin
if(FindColor(x,y,Sword,564,214,726,451)) then //Finds Swordfish in Inv
begin
wait(300);
ClickMouse(x,y,mouse_Left); //Eat
wait(randomrange(500,700));

end;
end;
end;

But its not eating for some reason.


Procedure Eat;
Begin
If FindColor(x, y, Hit, 8, 5, 516 ,333 ) then
Begin
FindColor(x, y, Sword, 564, 214, 726, 451);
Wait(300); //Showing an Error Here.
Mouse(x, y, 5, 5, True);
Wait(RandomRange(500, 700));
End;
End;

That should do it.

Example

2012-04-09 11:47:45

From: abu_jwka
Use better colors or maybe even make a DTM for the food you want to eat.

What is is that you want to eat exactly?


Trying to End sword fish which are inside my Inventory every time the guard that im pickpocketing catches me.

Example

2012-04-09 11:51:03

From: Failure

Procedure Eat;
Begin
If FindColor(x, y, Hit, 8, 5, 516 ,333 ) then
Begin
FindColor(x, y, Sword, 564, 214, 726, 451) //Can use MIX1, MIY1, MIX2, MIY2 instead I guess (Main Inventory)
Wait(300);
Mouse(x, y, 5, 5, True);
Wait(RandomRange(500, 700));
End;
End;

That should do it.


Started Scripting yesterday so im not sure how the MIX1, MIX2 Etc.. Are used, that will be the next thing i look into.

Just tried you modification of my script but im now getting an error somewhere else, on the "wait(300);

Procedure Eat;
Begin
If FindColor(x, y, Hit, 8, 5, 516 ,333 ) then
Begin
FindColor(x, y, Sword, 564, 214, 726, 451)
Wait(300); //Showing an Error Here.
Mouse(x, y, 5, 5, True);
Wait(RandomRange(500, 700));
End;
End;


Failure

2012-04-09 11:54:07

From: Example
Started Scripting yesterday so im not sure how the MIX1, MIX2 Etc.. Are used, that will be the next thing i look into.

Just tried you modification of my script but im now getting an error somewhere else, on the "wait(300);

Procedure Eat;
Begin
If FindColor(x, y, Hit, 8, 5, 516 ,333 ) then
Begin
FindColor(x, y, Sword, 564, 214, 726, 451)
Wait(300); //Showing an Error Here.
Mouse(x, y, 5, 5, True);
Wait(RandomRange(500, 700));
End;
End;



It's oke you'll get used to it, I ran the Procedure myself I'm not getting errors, you sure you copied it properly?

Abu

2012-04-09 11:56:48

You didn't put a semicolon after your FindColor function.


EDIT: The one above Wait(30);


EDIT2: to use MIX1 etc… just replace it with your co-ordinates, like this:
FindColor(x, y, Sword, MIX1, MIY1, MIX2, MIY2)

Failure

2012-04-09 11:58:39

From: abu_jwka
You didn't put a semicolon after your FindColor function.


EDIT: The one above Wait(30);


EDIT2: to use MIX1 etc… just replace it with your co-ordinates, like this:
FindColor(x, y, Sword, MIX1, MIY1, MIX2, MIY2)




When I run it myself without semicolon it still works. Though you are right, I forgot it I added it myself when I was testing I forgot only after a if statement there's no semicolon.

Example

2012-04-09 12:07:56

What exactly does the MIX1, MIX2 etc.. Do? Ill read into more just don't like using things that i don't really understand, just means more confusion if i need to change anything.

Failure

2012-04-09 12:09:54

From: Example
What exactly does the MIX1, MIX2 etc.. Do? Ill read into more just don't like using things that i don't really understand, just means more confusion if i need to change anything.


It's basically just the coordinates of your inventory but in a shortcut instead of getting the coords yourself. MI = Main Inventory.

Abu

2012-04-09 12:11:53

From: Example
What exactly does the MIX1, MIX2 etc.. Do? Ill read into more just don't like using things that i don't really understand, just means more confusion if i need to change anything.


Searches the main inventory.

MI - stands for Main Inventory.
X1 co-ordinate - searches from the top left corner
Y2 co-ordinate - searches till the bottom right hand corner.

The co-ordinates in between are just the other two corners (bottom left, top right)

EDIT:
You can also replace MI with:
- MS: Main Screen
- MM: Mini Map

Example

2012-04-09 12:13:12

From: Failure
It's basically just the coordinates of your inventory but in a shortcut instead of getting the coords yourself. MI = Main Inventory.


ahh ok. Im now having another problem..


//Eating

procedure Eat;
begin
if(FindColor(x,y,Hit,8,5,516,333)) then
begin
if(FindColor(x,y,Sword,564,214,726,451)); //Error showing here
wait(300);
Mouse(x, y, 5, 5, True); //Error shows here also
wait(randomrange(500,700));

end;
end;


Seems like im just getting more problems.

Failure

2012-04-09 12:15:42

From: Example
ahh ok. Im now having another problem..


//Eating

procedure Eat;
begin
if(FindColor(x,y,Hit,8,5,516,333)) then
begin
if(FindColor(x,y,Sword,564,214,726,451)); //Error showing here
wait(300);
Mouse(x, y, 5, 5, True); //Error shows here also
wait(randomrange(500,700));

end;
end;


Seems like im just getting more problems.


Procedure Eat;
Begin
If FindColor(x, y, Hit, 8, 5, 516 ,333 ) then
Begin
FindColor(x, y, Sword, 564, 214, 726, 451); // As Abu said, I forgot the Semi-Colon here.
Wait(300);
Mouse(x, y, 5, 5, True);
Wait(RandomRange(500, 700));
End;
End;

Didn't that work?

Abu

2012-04-09 12:16:11

The first error - you need a then after the FindColor function

Second error - you need a begin before wait(300) and then another end after Wait(randomrange(500,700)); - this is because you are doing more than one thing if you find that color

Example

2012-04-09 12:23:12

Ok so i found the problem, added what Abu said but found that i had a wrong line.


//Eating

procedure Eat;
begin
if(FindColor(x,y,Hit,8,5,516,333)) then
begin
if(FindColor(x,y,Sword,564,214,726,451)) then
begin
wait(300);
MoveMouse(x,y,Sword,564,214,726,451)); //If was Finding the Food twice.. This needed to be ClickMouse(x,y,mouse_Left);
wait(randomrange(500,700));

end;
end;
end;

Ill run and see if it works. Ill let you know the results.

Example

Abu

2012-04-09 12:27:04

Woah!! That will not work! MoveMouse only has two parameters - x and y. Everything else you have added is unnecessary.


EDIT: Also, MoveMouse doesn't click anything - it simply moves the mouse

Example

2012-04-09 12:28:07

I was attacked and it still didn't eat, Both the colour codes are correct as i checked them. Its like it just bypasses the "Eat;" procedure all together.

Can the way the procedures are listed in the main loop affect how they work?


//Main Loop


Begin
repeat

Steal;
Alch;
Eat;

until(false);
end.

Right now i have it eating after Its pickpocketed the guard and alched the item, should i swap it around to have it Steal, then if its been attacked it should heal and then alch the item.

Edit: Didn't make any difference, still not eating.

Abu

2012-04-09 12:29:51

AARRGHHH!! I don't even have Simba on my laptop :(

Pm me your script and I'll fix it :p

Example

2012-04-09 12:34:29

From: abu_jwka
AARRGHHH!! I don't even have Simba on my laptop :(

Pm me your script and I'll fix it :p


Do you have skype or TV? Id like to be able to see the mistakes and know how to fix them.

Abu

2012-04-09 12:39:13

From: Example
Do you have skype or TV? Id like to be able to see the mistakes and know how to fix them.


No sorry. I guess I could create a Skype account but I really don't want to.

Sorry :redface:


Maybe ask Failure?

Example

2012-04-09 12:40:52

From: abu_jwka
No sorry. I guess I could create a Skype account but I really don't want to.

Sorry :redface:


Ahh ok. Ill send you the script but please do not post it publicly. Its a private script and id like to keep it way that for now.

Could you also type little comments using the //text here so i can see what was wrong.


Example

Failure

2012-04-09 12:50:09

I might be also able to help out, I do have Teamviewer and Skype.

Example

2012-04-09 12:54:21

From: Failure
I might be also able to help out, I do have Teamviewer and Skype.


Ok mate well i have sent it to Abu, if he can't seem to work out then if your still willing to take a look that'd be great.

Example

Failure

2012-04-09 12:56:41

From: Example
Ok mate well i have sent it to Abu, if he can't seem to work out then if your still willing to take a look that'd be great.

Example


Sure will, I'll pm you my Skype if you need me instant.

Example

2012-04-09 13:27:46

Script just doesn't want to eat regardless off how its done. Guess ill come back to it, time to work on the anti ban.

Olly

2012-04-09 14:15:57

It will only eat when it needs to…?

Ive made a bunch of private server bots and this was like arma gwd i think

procedure CheckHp;
var
x, y:Integer;

begin
if FindColorSpiralTolerance(x, y, 65535, 733, 20, 751, 33, 5) or //under 75
FindColorSpiralTolerance(x, y, 2070783, 733, 20, 751, 33, 25) or //under 40
FindColorSpiralTolerance(x, y, 255, 733, 20, 751, 33, 10) Then // under 20
begin
WriteLn('Healing')
if FindColorSpiralTolerance(x, y, 3592916, 548, 202, 735, 470, 15)then
Mouse(x,y,1,1,true);
Wait(1650)
if FindColorSpiralTolerance(x, y, 3592916, 548, 202, 735, 470, 15)then
Mouse(x,y,1,1,true);
Wait(1650)
if FindColorSpiralTolerance(x, y, 3592916, 548, 202, 735, 470, 15)then
Mouse(x,y,1,1,true);
Wait(1650)
if FindColorSpiralTolerance(x, y, 5187222, 548, 202, 735, 470, 2)then
Mouse(x,y,1,1,true);
Wait(1650);
WriteLn('Healed Back Up')
end else
begin
writeln('No Brews');

TerminateScript;
end
end;

Example

2012-04-09 14:30:18

Think i have sorted the problem. After Failure helped me out we had the script moving the mouse to the food in Inv but not clicking. had to go out so was no able to figure out the problem.

Just came back and had a little mess around and think i may have sorted it, ran it for 10minutes and it seemed to do what it was ment to but 10minutes isn't long enough to guarantee that its working 100%.

Example

2012-04-09 15:22:03

Anyone willing to help me out with the AntiBan? Need to the script to log out and straight back in, this way it bypasses the random.

Not looking to be spoonfeed, just some help getting started as its the only way to learn someone doing it for you teaches you nothing.

Failure

2012-04-10 06:33:45

From: Example
Anyone willing to help me out with the AntiBan? Need to the script to log out and straight back in, this way it bypasses the random.

Not looking to be spoonfeed, just some help getting started as its the only way to learn someone doing it for you teaches you nothing.


Will help when you're on Skype.