JAD
2007-03-03 23:22:54
Uber Bros productions introduces: UberPedia! this tutorial will cover a lot of the SRL manual with detail and explanation. hope you enjoy, and I will be updating this tutorial a lot so keep your eyes open for updates :) I will be use some ===='s to seperate new commands.
Updates:
March 3rd, first release before I go to bed :p
before reading this tutorial, you may want to know the basics of the following:
variables
constants
repeats/untils
color clicking
and waits.
if you don't know most of these, then I would suggest reading one of my other tutorials "5 steps to becoming a scripter" that should help with that :p now lets begin:
here is all of the (current) commands this tutorial will go over:
MMouse(x,y,0,0); //Moves mouse at a slow, randomspeed to destination.
Mouse(x,y,0,0,true); //Clicks mouse with random holding timing
DropAll; //Drops all items in inventory
DropTo(2,28); //Drops from slot 2 to slot 28.
InvFull; //I will explain below.
TypeSend(''); //will send anything between the quotes then press enter.
isfkeydown //will explain below
now those are some basic procedures which can be very important when making something such as a power miner, or a power cutter. so we'll start by explaining MMouse. lets break this down. MMouse is a command to move the mouse. x,y is something i used as an example as coordinates, x,y are the variables at which the coordinates are stored. 0,0 are a randomness of where it can move. once it finds the color it will move the mouse to the color then it can move a little randomly off course … example:
procedure Example1;
begin
if(FindColor(x,y,color,coords,coords,coords,coords))then
MMouse(x,y,0,0);
end;
so that would be how you use MMouse.=====================================================================
How To Use Mouse:
ok to use mouse it is a lot like MMouse, but it just clicks instead. lets go straight to the example:
procedure Example2;
begin
if(FindColor(x,y,color,coords,coords,coords,coords))then
MMouse(x,y,0,0);
wait(100+random(50));
Mouse(x,y,0,0,true);
end;
so as you can see there, if it finds the color it moves the mouse to the spot, waits 100-50 milliseconds randomly before clicking to be less detectable, then clicks the mouse at the coordinates. the true in (Mouse(x,y,0,0,true)) is for left clicking. true=left click false=right click as you may know from reading other tutorials. this will not compile, will talk about that later. moving on.=====================================================================
How to use DropAll/DropTo and (inventoryfull):
well the DropAll is pretty self explanatory, simple yet important in power miners/fishers/woodcutters etc.. I'll go to the example then explain:
program Auto;
{.include SRL/SRL.scar}
procedure RepeatClicking;
begin
repeat
if(FindColor(x,y,color,coords,coords,coords,coords))then
MMouse(x,y,0,0);
wait(100+random(50));
Mouse(x,y,0,0,true);
until(InvFull);
end;
procedure Drop;
begin
DropAll;
end;
begin
SetupSRL;
repeat
RepeatClicking;
Drop;
until(false);
end.
Now we're talking! here we have a basic script that clicks a color, and repeats until the inventory is full, then it drops it! then in the main loop we made it repeat until(false) which means until you stop it manually by pressing the hot keys to stop a script. now lets just talk really quick about the include SRL. this includes SRL into our scripts, which makes life a lot easier pretty much for us scripters. includes make things like MMouse, Mouse, DropAll etc.. and stuff like that work. then in the main loop we put SetupSRL so it sets up that include, but we DO NOT want to repeat it so we put it before the repeat.OK, now that we have that settled lets talk about the script :p this is a good script, but the only thing is, it drops all ores. what if we have a few things in our inventory we don't want it to drop? like an axe or something for example? heres how we'd do that:
program Auto;
{.include SRL/SRL.scar}
procedure RepeatClicking;
begin
repeat
if(FindColor(x,y,color,coords,coords,coords,coords))then
MMouse(x,y,0,0);
wait(100+random(50));
Mouse(x,y,0,0,true);
until(InvFull);
end;
procedure Drop;
begin
DropTo(2,28);
end;
begin
SetupSRL;
repeat
RepeatClicking;
Drop;
until(false);
end.
now look at procedure Drop. we have DropTo(2,28) once inventory is full, it will drop everything in slot 2 of your inventory through 28. so it will drop inventory slots 2 3 4 5 6…etc… 24 25 26 27 28. you could change it to DropTo(3,27) or (3,28) or whatever you want. just make the slots you make it drop you don't have your valuable items in like a pick axe or something like that.=====================================================================
OK Now lets do something really fun and do an auto talker! Now I'll just go straight to the example and explain after:
program New;
{.include SRL/SRL.scar}
const
Message1 ='This Uber Tut Is Made By JAD!';
Message2 ='UBS=Uber Brothers Productions. UBS FTW!';
Message3 ='you are doing very well reading this uber tut by JAD/UBS.';
procedure AutoTalk;
begin
if(IsFKeyDown(2))then
begin
TypeSend(Message1);
end;
if(IsFKeyDown(4))then
begin
TypeSend(Message2);
end;
if(IsFKeyDown(5))then
begin
TypeSend(Message3);
end;
end;
begin
SetupSRL;
repeat
AutoTalk;
until(IsFKeyDown(12));
end.
Now we have a pretty cool script if I do say so myself. I like this script because it talks abouthow uber I am :p ok now lets get back on topic lol. now I'll explain this step by step. what we have here is an auto that while the script is running, if we press F2, F4 or F5, it will type a message! as you can see, i made the F2 key type the first message, F4 types the second message, and F5 types the last message. and i made this script repeat itself until we press the F12 key. convenient eh? well the IsFKeyDown checks if a FKey is down, and the number is which F key. the reason i didn't use F1 and F3 was because those open things when you press them, like if you press F1 it opens the SCAR manual. and What typesend does is it types with random timing between keys, very undetectable, and then it presses enter at the end. you can make these messages something like "Buying rune axe 15k!!!" or something like that so you don't have to type while playing runescape :p then Obviously we setup SRL and include it.
OK thats the end of the UberPedia for now. I will be adding a Lot more to this tutorial so keep checking up on it for updates :)