Jump to content
Ranqers

Improving script [help]

Recommended Posts

yoo,

just need some tips on my coding..always room for improving.

 

i've left this bot on for 6 hours, worked well. it's a RS Bot, not typically rs thou.

 

program testbottbh;
{.include procedures.scar}
var x,y,i,e,comp: Integer;
const U = '1245Pn'; //username
const P = 'no'; //password

procedure define;
begin
 comp := TSCARBitmap.Create('deNpjYmBiOLln6fTe8mYu7nNHNwMALU0GqA==');
end;

procedure typetextu;
begin
 TypeText(U);
 Wait(250);
end;

procedure typetextp;
begin
 Wait(300);
 TypeText(P);
 Wait(250);
end;

procedure compus; //sets compus to N
begin
 if Not(FindBitmap(x,y,comp,518,1,561,43)) then
 begin   
   Wait(150);
   MMC(545,23,False);
   Wait(550);  
 end;
end;

procedure heal;
begin
 if FindColor(x,y,26,695,31,718,38) then
 begin
   MMC(580,230,True);
   Wait(350);
   MMC(580,272,False);
   Wait(30);
 end;
end;

procedure thiev; //stalls
begin
 if FindColor(x,y,8961996,225,100,379,155) then
 begin  
   e := x-30;
   i := y+30;
   MMC(e+random(5),i+random(5),False);
   Wait(350+Random(50));
 end;
end;

procedure startup;
begin
 compus;
 heal;
end;

procedure logfix; //login-script
begin
 if Not(FindColor(x,y,1776730,405,480,443,502)) then
 begin
 repeat
   Wait(1500);
 until(FindColor(x,y,2558547,30,296,44,312));
   Wait(650);
   MMC(294,437,False);
   Wait(350);
   MMC(281,226,False);
   Wait(350);
   typetextu;
   MMC(281,277,False);
   typetextp;
   MMC(363,324,False);
   Wait(3500+random(150));
   startup;
 end;
end;

begin
define; //*
logfix; // Bot startup
startup; //*
repeat
 heal;  //*
 compus; // Main loop
 thiev; //*
until(false);
end.

Link to comment
Share on other sites

That was in a spur of the moment thing, my bad lol.

 

You should use OSI with your script. I can't believe you did it all by scratch!

 

In SCAR DIVI go to File->Includes Manager install OSI. Then go to Tools->Explore->Includes Folder,

and the Official SCAR Include (OSI). Focuses primarily on RS2 functionality. And this is the template script for that and with login:

 

This script when you fill out the information in Players[0], will login to Runescape 2 for you automatically. Also it uses SMART - Smart Autoing Resource Thing to load RS2 in a sandbox so you don't have to have an internet browser open.

 

[scar]

program New;

 

{$DEFINE RS2}

{$DEFINE OSI_Color_Anti_Randoms}

{$DEFINE SMART} // Comment out to disable SMART

// and use browser instead

{$I OSI\OSI.scar}

 

procedure ScriptTerminate;

begin

FreeOSI;

end;

 

procedure SetupPlayers;

begin

SetLength(Players, 1);

with Players[0] do

begin

Login := 'Test';

Pass := 'Test';

Member := False;

Active := True; // Puts in Active player list (used for login function)

end;

end;

 

begin

SetupPlayers;

SetUpOSI;

if Login then

WriteLn('Congratz!');

end.

[/scar]

 

There is also a function to set the compass to north called ClickCompass.

Link to comment
Share on other sites

something i've always been interested in: SMART client.

i'm not botting on RuneScape, simply because it's stupid. i do, however, bot on eco-based RSPSs for practice and fun. :)

 

is there any way of modifying the SMART client?

 

 

Edit: and thanks for your input btw, i've always liked to make things from scratch. also made that include;D

Edited by Ranqers
Link to comment
Share on other sites

something i've always been interested in: SMART client.

i'm not botting on RuneScape, simply because it's stupid. i do, however, bot on eco-based RSPSs for practice and fun. :)

 

is there any way of modifying the SMART client?

 

 

Edit: and thanks for your input btw, i've always liked to make things from scratch. also made that include;D

 

Yeah it seems Jani, MSSL, his RSP scripts, RSC and other things has people from private servers and runescape classic newbs comin in every day. And even some non newbs like you :P.

You should really look into Janilabos MSSL Include, he has includes for Runescape classic, and I think Runescape private server. But i am not sure on the details totally.

 

Anyway, SMART is very awesome, but I just wish it was built better, and had more options for it. The source is java based and its on github here if you want to change the client: https://github.com/BenLand100/SMART

 

So yeah you can't really modify it too much because when it loads it has this thing in the command prompt that says: GetParam. And I think what it does is, it gets the params from the URL that are for RS2. I think this gets in the way. So you can't load anything else besides RS2 inside of it. No pservers, no rsclassic. I actually tried it the other day did a bunch of testing and I got to it saying in command prompt "Waiting for client" but it never loaded lol it was sad. That was me trying to load rsclassic though.

 

The functions for it you can type in SMART then hit CTRL+Spacebar to bring up the function list. OSI/RS2/Misc/Smart.scar has a bunch of functions OSI uses with the SMART client...we only have version 7.1 because beyond that Freddy (SCAR's creator) would have to change the framework to interact with it.

Link to comment
Share on other sites

Yeah a flawless script is a fallacy, but you can get it working really good with failsafes and tons of things.

 

Javascript? Whaaaaaaaaaaaaaaaaaaaaaaaat. Powerbot is JAVA not javascript afaik...

Javascript is web programming, and is totally different from java.

 

myb was thinking about programming the runescape servers.

Link to comment
Share on other sites

Well the scripts could be "programmed" in javascript. But the actual Powerbot client is JAVA afaik.

 

Now as for programming runescape servers, i'm lost there..

 

the rs2 servers are owned and maintained by jagex you can't program them.

 

 

yea its not possible to change the rs client to connect to different servers. but there are clients out there, like moparscape client for instants, that can.

Link to comment
Share on other sites

yea its not possible to change the rs client to connect to different servers. but there are clients out there, like moparscape client for instants, that can.

 

Yeah if you can find one that does that, but as for "Minimizable" it probably wouldn't be. So would defeat the purpose of the "SMART". Its nice to have it so you don't need an internet browser. For good includes, idk if MSSL is good at this but. Should be fine with just selecting the client on the game like the "moparscape client".

 

For OSI, I made it so you could change the RSX1~RSY2 parameters. Which are used in some search functions. A lot of the include still needs to be adjusted for that however...

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