Jump to content
tweakmeup

runescape botting

Recommended Posts

I'm interested in creating a script for runescape for two characters (seperate scripts on seperate computers). The first would be to fish with a harpoon at karamja, and the other would be returning the fish to the bank and walking back to the fishing location. I understand the general guidelines on creating the scripts, with the begin/ends and what constants/cariables and other things are, i'm just confused on how it goes together to create a complete script.

 

One thing I have no clue about, is how to make your character go from point A, to point B. I assume its with the radar mapping, but that may be solely for rs2. The second thing, how do I go about telling the bot where to click, such as x and y coordinates? And thirdly, the two bots will need to click on each other and trade from the options menu, when the banker returns. I'm unsure how to make the bots right click, and also if the fisher gets his load before the banker returns, how do i make him wait until the banker does actually return. I know this is a lot of questions, and I don't even have a script started yet, but to be honest, the tutorials are great and all, but it gets completely different when you actually try to implement what you learned into making a bot. Thanks everyone, and I'm only posting this to learn, so any constructive criticism is greatly appreciated.

Link to comment
Share on other sites

Has to be same computer I think. Check out the MessagePlane, and MessageTower files in here xD - https://github.com/OSI1/OSI1/tree/master/Examples

For cross computer, you could connect to lets say... a free website and change data on there. Then the other computer could read the data. Or you could somehow connect the computers with a USB cord?

 

 

Well my friend, you have summarized the main problem around here. You can understand how stuff works, but there isn't really a guide here on how you should go about implementing all of this.

 

Tbh. I need to make one really bad. There is plenty of tutorials, but none cover your exact cause here. Of Runescape 2 botting. You're best bet is to look at some of the old RS2 (Runescape 2) scripts that were made.

 

The radar walking might work. And everything else there is functions for. You could do it! xD just check out the OSI include.

 

 

There is some tutorials on making runescape scripts around here...some where I think. And there is THAT website. That has tons of tutorials on it. But might be out dated/misleading?/not SCAR Divi program...

Edited by LordJashin
Link to comment
Share on other sites

Hmm I assumed you knew some of that already but if you need help go check out

 

The-All-In-One-Beginners-Guide-To-SCAR-Divi!

 

I made it, it still needs to be improved though. I should make one in PDF version or something...

 

arrrrrghh, I've read that already and now just read through the includes part in more detail. I also took a look at the list of available OSI includes from the repository. None if which I even know what they are for haha. It's just the fact that the tuts are all using numbers and verrrry basic inserts in the functions, but I think the most basic things I need to learn are 1) how to write walking into the script, and how to get/use parameters like these (248, 256, x, y, 16578808, 5, 141, 480, 316).

Link to comment
Share on other sites

Freddy, will does the inter-scar messaging work across computers, or do they have to be on the same computer? Would solve one problem.

 

It only works on 1 machine. If you'd write a small TCP server in Delphi or another language, it would be possible to connect multiple instances of SCAR to each other through this server with the TCP api though.

Link to comment
Share on other sites

Okay Jashin, that's helpful. But I still would like someone to lead me to the answers of my previous questions:

 

arrrrrghh, I've read that already and now just read through the includes part in more detail. I also took a look at the list of available OSI includes from the repository. None if which I even know what they are for haha. It's just the fact that the tuts are all using numbers and verrrry basic inserts in the functions, but I think the most basic things I need to learn are 1) how to write walking into the script, and how to get/use parameters like these (248, 256, x, y, 16578808, 5, 141, 480, 316).

 

Edit: basically I would have the fisher fish a full inventory, then begin searching for a trade message from the banker, in which he would accept and trade the fish, then continue fishing until he had another load etc. I just need to find out the information above :).

 

Edit2: Crap, I think I should add that i'm botting prsc, not rs2! I think I read that OSI is specifically RS2 and i've actually used an OSI bot that kept giving me errors (something about colors), and now I know why.

Edited by tweakmeup
Link to comment
Share on other sites

What exactly is prsc? I can't help you make this script until I know what it is...exactly that you are scripting for... Is it just a RS2 private server?

 

You mean Runescape Classic? Then you should take a look at the MSSL include and the scripts that Jani (the maker of it) has been coming out with. Along with other peoples...Check out SCAR Divi -> File -> Includes Manager -> Install MSSL.

 

Then there is some scripts around here that use MSSL.

 

http://forums.scar-divi.com/forumdisplay.php?48-Games All in this section...

 

EDIT: And if you want to know how to script something like your describing... Here it is:

 

1. You figure out all the different things your script would need to be able to do for you.

2. You try to find if any of these "includes" can help you with your game maybe...

3. You start creating functions to do whatever you need your script to do for you.

Using finding methodology.

 

FindBitmap,

FindColor,

FindDTM

CountColor(Red) > 50

 

Then you figure out how to use the finding methodology while making functions that use them...

And you can use the wiki for some help.. wiki.scar-divi.com

 

Here I'll dissect find color real qwik.

 

uLiCT.png

 

out - Means this value will be set to something. Returned...out...

var - same as out. For BOTH of these. Whatever you put here has to be a variable and it will be set when the function runs

 

So here we go:

 

X, and Y are variables we created to be set. In the function FindColor. The x, and y params are always set to where the color is found IF IT IS FOUND

 

Color is another variable I put in there, that we can define. I could just replace that with an integer value such as 0.

 

B := FindColor(x, y, Color, 0, 0, 150, 150);

 

0, 0 - 150, 150 is the search area. This is where we look for the color

Untitled.png

Edited by LordJashin
Link to comment
Share on other sites

Yes it is runescape classic private server, and I have been using a couple of his bots, I just want to begin to make my own. And the only things I'm not understanding are how to get the bot to click (because I don't understand the incredible amount of parameters(x,y,123, blah blah), or how to get the parameters. If I knew, then I could theoretically build my first bot from a basic one amberleaf made.

 

To be more specific...

 

If FindColorSpiral(248, 256, x, y, 16578808, 5, 141, 480, 316) then

begin

MMouse(x, y, 0, 0);

Wait(1000);

GetMousePos(x1, y1);

If FindBitmap(x, y, Bmp, 32, 4, 79, 14) or FindColor(x, y, 16777215, 172, 8, 172, 8) then

begin

Mouse(x1, y1, 0, 0, True);

Wait(1000);

end;

 

this line of code (findcolorspiral) and all the integers and x's and y's are very confusing to me, in both where they come from and what they are for.

Edited by tweakmeup
Link to comment
Share on other sites

Well I actually like the image in the findcolorspiral example on the wiki xD - http://wiki.scar-divi.com/index.php?title=FindColorSpiral

 

I think the wiki might actually teach it well. But here I go:

 

---------

 

MMouse is from the OSI Include but the rest are from SCAR Divi of course.

 

Spiral means that when searching for the color it spirals out. As shown WONDERFULLY by Freddy's ingenious picture. That I take no credit for, and wonder how he managed to get such an awesome piece of digital art - http://wiki.scar-divi.com/images/b/ba/FindColorSpiral.gif

Its like photoshop frames or something even more awesome.

 

Params are important in programming languages. If only you knew how programming languages usually work. Since you don't you need to grasp that. I can declare a function. Give it a name. Give it whatever parameters I like. So I could make my own function called HitFreddyWithStick then its params could be:

 

1time, 2times, or 3times. I could make it a true or false thing so now its more advanced...1time: Boolean; (semi colon means Ooo its separating something LIKE a comma) 2times: Boolean; 3times: Boolean. Now this is just me "declaring" or "naming" everything first. If I was to actually USE the HitFreddyWithStick function with those params it would be:

 

HitFreddyWithStick(

the paranthesis( is WHERE the params go that YOU are giving to MY declared function earlier e.g. the 1time: Boolean

 

so HitFreddyWithStick(True, True, True)... so in total poor freddy is going to be hit 6 times...

 

 

Now params get more advanced. They can give back values. They can be Colors, Array, sets, and BATTLESHIPS. But in general they are usually:

 

- A search area like XS, YS, YE... etc. x1, y1, x2, y2....lalalala

- A Color, Bitmap, DTM, anything. usually this is what is searched for. Maybe this is being set? who knows depends on the function

- Then maybe a typical return values that the function return so.... function HitFreddyWithStick(params: Boolean , etc.): ReturnVariable; Can be like a boolean

 

Like uh. Odd function ..returns a boolean. So you can do...if Odd(3) then Flip the fuck out cuz 3 is an odd number :D

 

Then there is X, Y. That these finding function typically like to tell you where IT was found.

 

So here it is now in full view:

 

[scar]

program aaa;

 

var

x, y, Color: Integer;

SomeColorValueThatISHEXORSHIT: Integer;

begin

 

SomeColorValueThatISHEXORSHIT := ClBlack; // cl red iS BLACK OMG

 

Color := SomeColorValueThatISHEXORSHIT;

if FindColor(x, y, Color, 0, 0, 500, 500) then

WriteLn(IntToStr(x) + ', ' + IntToStr(y) + ' flip the fuck out now');

end.

 

[/scar]

 

And you can put functions that return something inside other functions when you use them.

 

So like

 

WriteLn(x);

 

If x was a number we could convert it to a string first like:

 

WriteLn(IntToStr(x));

 

IntToStr will return the Integer you passed to it ...as a string..

 

 

----------------

 

 

Now for writing your script:

 

[scar]

function Fish;

begin

if FindColor(FishColor) then

begin

HitFreddyWithStick(True, True, True);

FishWithPole(at x, y coordinate where fish was found); // ; ends the statement when u use it cuz it cant go on forever...

end;

end;

[/scar]

 

And heres the battleship i was talkin about:

 

l.jpg

 

</diez>

Edited by LordJashin
Link to comment
Share on other sites

That was a really great explanation, maybe you should add that to the wiki lol. So now comes the problem, how do you find the coordinates? and what are the coordinates relative to?

 

Edit: nevermind to the second part, I think it's just the middle of the screen, whatever you've selected. But I still need to know how to find the coordinates that you want it to scan out to.

 

Edit2: After reviewing a bit more of the wiki, can I use find bitmap to get the coordinates I want?

Edited by tweakmeup
Link to comment
Share on other sites

That was the single most helpful tutorial for runescape botting on this website. I noticed at the end, you were getting into Vkey functions, I did happen to see some of those on other people's scripts, but it was like this: GetKeyState(VK_F6) Not sure if that is the same thing, but it was referencing an If Then statement. Please post this in the tutorials section!! I'm sure it will help so many people. Thank you again Jashin!

 

Also, when running Amberleaf's karamja fisher/seller why do I get the error: Canvas does not allow drawing!? I'm trying to bypass it, so I can build off his current script, but I can't get past this error. Is it because the includes are OSI? I'd prefer to use MSSL, but when I do use MSSL, I keep getting "identifier expected" or "unknown Identifier" lol.

 

Edit:

 

program New;
begin
Procedure Fish;
var x, y, x1, y1: Integer;
Bmp, Bmp1: TSCARBitmap;
begin
Repeat   
 GetClient.Activate 
 If FindColorSpiral(377, 227, x, y, 12630971, 306, 183, 416, 273) Then
  begin
   MoveMouse(x, y);
     Wait(1000);
     GetMousePos(x1, y1);
end;                 
end.

 

This is my current script, not much as I just started, but when I leave the first begin-->end. out, it says unexpected end of file, when I put it in it says identifier expected on line 3, which is the Procedure fish; line. What am I missing here?

 

Edit2: I've expanded my script a bit. With the script as it is now, the bot moves the cursor to the first position, and spirals around searching for the color, but the mouse just trickles around the location and the bot does not actually CLICK on said location. Also, I've noticed all of the scripts have something in the beginning referring to the includes, such as {$DEFINE PRSC}

{$I MSSL\MSSL.scar}. I still have no clue what this does, and how to "include includes" in my scripts :)

 

program New;
Procedure Fish;
    var x, Bmp, y, x1, y1: Integer;
begin
GetClient.Activate;
    Repeat 
    Bmp := TSCARBitmap.Create('deNp9krENgDAMBD0ALRNQUlLSUVIwANOwObz0y' +
        'esTwJYVOW9fbELGGGI5Lvq8l2DayhaBxPVsUtjCmcXK4K4WERLJwpXyGjWSCPP' +
        'uZOFKdTjKhEu/zaD8dVcXiTw/qr2pDueELn4OkODevRsmx1nsV+dsfo7wPyTH/' +
        'Qf58KrJv93fG+9ZVxGt8UwiChzvVr06Xz2gPxD1ZWI=');   
    If FindColorSpiral(256, 233, x, y, 16578808, 195, 183, 291, 264) Then
    begin
       MoveMouse(x, y);
       Wait(1000);
       GetMousePos(x1, y1); 
       If FindBitmap(x, y, Bmp, 26, 305, 48, 317) or FindColor(x, y, 16777215, 172, 8, 172, 8) then
       begin
        MoveMouse(x1, y1);
        Wait(1000);
       end;                       
    end;
until FindColor(x, y, 16777215, 278, 276, 328, 326) or GetKeyState(VK_F6);
end; 

Begin
repeat
GetClient.Activate;
Fish; 
until GetKeyState(VK_F12);  
end.

Edited by tweakmeup
Link to comment
Share on other sites

I am not great teacher (I am okay at scripting, but I really suck at teaching), but..

Your script needs mainloop, and you don't place procedures inside the mainloop like you have done right now.

 

You need to place them before mainloop, so then mainloop recognizes em and you can use em.

This is mainloop:

 

begin
end.

 

So your script should be something like this (only an example):

 

procedure Fish;
var
 x, y, x1, y1: Integer;
 Bmp, Bmp1: TSCARBitmap;
begin
 repeat
   if FindColorSpiral(377, 227, x, y, 12630971, 306, 183, 416, 273) Then
   begin
     MoveMouse(x, y);
     Wait(1000);
     GetMousePos(x1, y1);
   end;
 until False; // Change False to something else, though. 
end;

begin
 GetClient.Activate;
 Fish;
end.

Link to comment
Share on other sites

I am not great teacher (I am okay at scripting, but I really suck at teaching), but..

Your script needs mainloop, and you don't place procedures inside the mainloop like you have done right now.

 

You need to place them before mainloop, so then mainloop recognizes em and you can use em.

This is mainloop:

 

begin
end.

 

So your script should be something like this (only an example):

 

procedure Fish;
var
 x, y, x1, y1: Integer;
 Bmp, Bmp1: TSCARBitmap;
begin
 repeat
   if FindColorSpiral(377, 227, x, y, 12630971, 306, 183, 416, 273) Then
   begin
     MoveMouse(x, y);
     Wait(1000);
     GetMousePos(x1, y1);
   end;
 until False; // Change False to something else, though. 
end;

begin
 GetClient.Activate;
 Fish;
end.

 

Thanks Janilbo. The second Edit still stands, although the first is solved. Also, whenever I put Bmp under the Var, it says there is a semicolon expected, which there shouldn't be. So it seems I need to put it in with the others, but the Bmp isn't an integer, so i'm lost on that front.

Edited by tweakmeup
Link to comment
Share on other sites

After working with it a bit more, i've found out how to make the bot click, which i've added into the script. Now, I can't get it to STOP clicking LOL. I thought the "until bmp1" section where i've bitmapped the "full" portion of the message that you get when your inventory is full would make the bot stop clicking because it found the "full" bitmap and realized it's inventory was full.

 

program New;
Procedure Fish;
var x, y, x1, bmp, bmp1, y1: Integer;         
begin
GetClient.Activate;
    Repeat 
    Bmp := TSCARBitmap.Create('deNp9krENgDAMBD0ALRNQUlLSUVIwANOwObz0y' +
        'esTwJYVOW9fbELGGGI5Lvq8l2DayhaBxPVsUtjCmcXK4K4WERLJwpXyGjWSCPP' +
        'uZOFKdTjKhEu/zaD8dVcXiTw/qr2pDueELn4OkODevRsmx1nsV+dsfo7wPyTH/' +
        'Qf58KrJv93fG+9ZVxGt8UwiChzvVr06Xz2gPxD1ZWI=');
    bmp1 := TSCARBitmap.Create('deNqNk7EOwjAMRP0D7PwEI1vHbowM7HwMv926e' +
   'nA6Ja5FFVVOfD6fHecal7g9PsvrWPfnd7Fd38dKLyfyCiAMhs633xcRuPJPlsT' +
   'INWDEM8AAOCa9yVbyuHhsF+PI+dC9c8YyNr1/8khSGVu2Za4Lhoanr0skXAdUZ' +
   'WyvRxp8GBoNZzxzowaePupskODR5CBSW4wsfzhROloqHr9BfxQ0kL83lhJ8qjV' +
   'CPlHYChehMqKZV0PUDu/UweU=');                                                          
    If FindColorSpiral(256, 233, x, y, 16578808, 195, 183, 291, 264) Then
    begin
       MoveMouse(x, y);
       Wait(1000);
       GetMousePos(x1, y1);
       begin
         ClickMouse(x, y, mbLeft);
         Wait(1000);
       end; 
       If FindBitmap(x, y, Bmp, 26, 305, 48, 317) or FindColor(x, y, 16777215, 172, 8, 172, 8) then
       begin
        MoveMouse(x1, y1);
        Wait(1000);
       end;                          
    end;   
until FindBitmap(x, y, Bmp1, 102, 293, 126, 305);
end; 

Begin
repeat
GetClient.Activate;
Fish; 
until GetKeyState(VK_F12);  
end. 

Link to comment
Share on other sites

Hey mate, try this:

 

function LoggedIn: Boolean; // Known as PRSC_LoggedIn in MSSL [http://svn.scar-divi.com/mssl/trunk/Library/Gaming/Project_RSC/Core/Login.scar]
begin
 Result := (CountColor(4775, 416, 333, 498, 341) > 350);
end;

var
 fullInventory: Boolean;
 bmp, bmp1: TSCARBitmap;

procedure Fish;
var
 x, y, x1, y1: Integer;         
begin
 repeat 
   GetClient.Update;
   GetClient.Activate;
   if not LoggedIn then 
     Exit;
   fullInventory := FindBitmap(x, y, Bmp1, 102, 293, 126, 305);
   if not fullInventory then                                                   
     if FindColorSpiral(256, 233, x, y, 16578808, 195, 183, 291, 264) then
     begin
       MoveMouse(x, y);
       Wait(1000);
       GetMousePos(x1, y1);
       begin
         ClickMouse(x, y, mbLeft);
         Wait(1000);
       end; 
       if (FindBitmap(x, y, Bmp, 26, 305, 48, 317) or FindColor(x, y, 16777215, 172, 8, 172, 8)) then
       begin
         MoveMouse(x1, y1);
         Wait(1000);
       end;                          
     end;   
 until (fullInventory or not LoggedIn); // You should add also a LoggedIn check.. 
end; 

begin
 bmp := TSCARBitmap.Create('deNp9krENgDAMBD0ALRNQUlLSUVIwANOwObz0y' +
      'esTwJYVOW9fbELGGGI5Lvq8l2DayhaBxPVsUtjCmcXK4K4WERLJwpXyGjWSCPP' +
      'uZOFKdTjKhEu/zaD8dVcXiTw/qr2pDueELn4OkODevRsmx1nsV+dsfo7wPyTH/' +
      'Qf58KrJv93fG+9ZVxGt8UwiChzvVr06Xz2gPxD1ZWI=');
 bmp1 := TSCARBitmap.Create('deNqNk7EOwjAMRP0D7PwEI1vHbowM7HwMv926e' +
      'nA6Ja5FFVVOfD6fHecal7g9PsvrWPfnd7Fd38dKLyfyCiAMhs633xcRuPJPlsT' +
      'INWDEM8AAOCa9yVbyuHhsF+PI+dC9c8YyNr1/8khSGVu2Za4Lhoanr0skXAdUZ' +
      'WyvRxp8GBoNZzxzowaePupskODR5CBSW4wsfzhROloqHr9BfxQ0kL83lhJ8qjV' +
      'CPlHYChehMqKZV0PUDu/UweU=');    
 Fish;  
end.

Link to comment
Share on other sites

Still just continues to fish :0.

I think it's because I don't specify what to do after saying Until full inventory. Mainly because I don't know what to make it do. I actually just want it to sit there and wait for the next bot i'm making to send it a trade message.

Hey mate, try this:

 

function LoggedIn: Boolean; // Known as PRSC_LoggedIn in MSSL [http://svn.scar-divi.com/mssl/trunk/Library/Gaming/Project_RSC/Core/Login.scar]
begin
 Result := (CountColor(4775, 416, 333, 498, 341) > 350);
end;

var
 fullInventory: Boolean;
 bmp, bmp1: TSCARBitmap;

procedure Fish;
var
 x, y, x1, y1: Integer;         
begin
 repeat 
   GetClient.Update;
   GetClient.Activate;
   if not LoggedIn then 
     Exit;
   fullInventory := FindBitmap(x, y, Bmp1, 102, 293, 126, 305);
   if not fullInventory then                                                   
     if FindColorSpiral(256, 233, x, y, 16578808, 195, 183, 291, 264) then
     begin
       MoveMouse(x, y);
       Wait(1000);
       GetMousePos(x1, y1);
       begin
         ClickMouse(x, y, mbLeft);
         Wait(1000);
       end; 
       if (FindBitmap(x, y, Bmp, 26, 305, 48, 317) or FindColor(x, y, 16777215, 172, 8, 172, 8)) then
       begin
         MoveMouse(x1, y1);
         Wait(1000);
       end;                          
     end;   
 until (fullInventory or not LoggedIn); // You should add also a LoggedIn check.. 
end; 

begin
 bmp := TSCARBitmap.Create('deNp9krENgDAMBD0ALRNQUlLSUVIwANOwObz0y' +
      'esTwJYVOW9fbELGGGI5Lvq8l2DayhaBxPVsUtjCmcXK4K4WERLJwpXyGjWSCPP' +
      'uZOFKdTjKhEu/zaD8dVcXiTw/qr2pDueELn4OkODevRsmx1nsV+dsfo7wPyTH/' +
      'Qf58KrJv93fG+9ZVxGt8UwiChzvVr06Xz2gPxD1ZWI=');
 bmp1 := TSCARBitmap.Create('deNqNk7EOwjAMRP0D7PwEI1vHbowM7HwMv926e' +
      'nA6Ja5FFVVOfD6fHecal7g9PsvrWPfnd7Fd38dKLyfyCiAMhs633xcRuPJPlsT' +
      'INWDEM8AAOCa9yVbyuHhsF+PI+dC9c8YyNr1/8khSGVu2Za4Lhoanr0skXAdUZ' +
      'WyvRxp8GBoNZzxzowaePupskODR5CBSW4wsfzhROloqHr9BfxQ0kL83lhJ8qjV' +
      'CPlHYChehMqKZV0PUDu/UweU=');    
 Fish;  
end.

Edited by tweakmeup
Link to comment
Share on other sites

{$DEFINE PRSC}
{$I MSSL\MSSL.scar}

procedure ScriptTerminate;
begin
 MSSL_Unsetup;
end;

var
 fullInventory: Boolean;
 bmp: TSCARBitmap;

procedure Fish;
var
 x, y: Integer;         
begin
 repeat 
   if not PRSC_LoggedIn then 
     Exit;                 
   fullInventory := FindBitmap(x, y, bmp, 3, 266, 76, 321); 
   if not fullInventory then                                                   
     if FindColorSpiral(256, 233, x, y, 16578808, 195, 183, 291, 264) then
     begin
       ClickMouse(x, y, mbLeft);
       Wait(500);
     end;
   MSSL_Wait(0);                          
 until (fullInventory or not PRSC_LoggedIn); // You should add also a LoggedIn check.. 
end; 

begin
 MSSL_Setup;
 bmp := CreateBitmapFromText('Your invent', PRSC_MainFont, 16777215); 
 bmp.TranspColor := 0; // This is IMPORTANT!
 Fish;  
end.

 

That fishes until inventory is full. :) But there is so many things that we need to pay attention to.. That only works at place where there is only same kind of spots.. Like Draynor, Lumbridge or Barbarian Village.

 

The problem was with your bitmaps, we needed to ignore any other colors except the text colors (white)..

 

-Jani

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...