SRL Archive - OSR Help

i am determined to make an low lvl alcher i need alitle help tho


print

2012-08-09 22:30:08

i need to know the procedures and functions like
movemouse

i want to know how to make it click and have a wait time
i dont know what to put like right click u know what i mean?
i pressed ctrl and doesnt give me suggestions

Kasi

2012-08-09 22:41:28

Mouse() moves the mouse to a coord, whether you choose true or false it will left click or right click, chooseoption() chooses an option, Wait() waits for a period of time. best way to learn is to look at other peoples scripts. also look into beginner tutorials

Nebula

2012-08-09 22:44:58

Mouse(x, y, xe, ye, false); will move the mouse to point(x, y) with a randomness of xe ye. Right click if false, left click if true.

ClickMouse2(false); will only right click.

GameTab(Tab_Magic); Will make the tab to magic (also works with Inv, etc)

Wait(1000); waits for 1000ms (1 second)

IsUpText('Text here'); returns true if the UpText (Text in upper-left corner) is the text you enter.

So for a basic alcher you could just do something like this:


repeat //repeats stuff until "until" is true.
if not FindNormalRandoms then //if your player is stuck in a random, stop the script
break;
GameTab(Tab_Magic); //moves to magic tab
Mouse(x, y, xe, ye, true); //clicks alch symbol at point(x, y) (You have to get the coordinates)
Wait(RandomRange(300, 600)); //waits for between .3 and .6 seconds
GameTab(Tab_Inv); //Makes sure the tab open is inventory;
Mouse(x, y, xe, ye, true) //Clicks item to alch
Wait(RandomRange(1200, 1800)); //waits while your player alches
until (Not loggedIn); //script will end if your player is logged out for whatever reason.


Flight

2012-08-09 22:55:21

Checkout how 'StreamMouse' in my MouseHandler (V1.01+) works and how to use it, it'll be a big help in your alching script.


function StreamMouse(MouseIn: MEvent; UpTextArr, RClickOptions: TStringArray;
UpTextWait, OptionsWait: Integer): Boolean;

That function requires a 'MEvent', use 'ConMEvent' to build one like so:

ConMEvent('normal', X_Coord, Y_Coord, X_Rand, Y_Rand, mouse_left);

And let's say you wanted to (normally) move the mouse to Point(250, 370) with 5 randomness added to both X & Y, wait for ''Magic Longbow' uptext (500) and right-click wait for option 'Cast High alchemy' (400) then you would do this:

Var
ME: MEvent;
begin
ME := ConMEvent('normal', 250, 370, 5, 5, mouse_move);
if StreamMouse(ME, ['Magic','Longbow'], ['Cast','High','alchemy'], 500, 400) then
Writeln('Success!');


Of course there's 1001 ways to do mouse-moving, text-check, option-choosing and so on, but if you were to use my MouseHandler, that's how you'd do it. It's meant to do it all in one motion.

Nebula

2012-08-09 23:03:06

From: Flight
…



I don't think someone who doesn't even know how to right click is going to be able to figure that one out. (No offense to print here)

print

2012-08-09 23:04:07

okay what am i doing wrong?



albredy
program new;
begin
movemouse(572,277);
end.
begin
clickmouse(true)
end.

print

2012-08-09 23:05:54

wont left click the spot

Nebula

2012-08-09 23:07:07

begin
MMouse(572, 280, 4, 4); //You needed the two randomness parameters. Also it should be MMouse
ClickMouse2(false);
end.
You should only put a period on the LAST end of your script. Semicolons on all other ends.

Mouse(572, 280, 4, 4, false); will do the same as the above. Mouse combines MMouse(); and ClickMouse2();

False= right click True= left click

And you need to define SRL in your script. This allows you to use the SRL include which is what everything RS-Related is in. You do this like so:



program ScriptName;
{$i SRL\SRL.simba}
begin
ActivateClient;
SetupSRL;

//The rest of the script goes here

end.


Flight

2012-08-09 23:09:11

From: Nebula
I don't think someone who doesn't even know how to right click is going to be able to figure that one out. (No offense to print here)


I didn't know he was at that point. :S

From: print123
okay what am i doing wrong?



albredy
program lollvlalcher;



begin
movemouse(572, 280);
end.
begin
ClickMouse2(false);
end.


Never use "MoveMouse", either MMouse or Mouse (for moving + clicking).

If you're at this stage then I strongly recommend watching YoHoJo's video tutorials:
http://villavu.com/forum/showthread.php?t=67691

EtherFreak

2012-08-10 00:29:08

heres the alk part…
(dont forget to put this at the beging of the script next to the srl include)

{.include SRL/SRL/skill/magic.simba} 

Procedure highalk;
Var
i:integer;
Begin
I:=1;
repeat
inc(i);
Cast('high level alchemy', false)
wait(100+random(100));
invmouse(I,1);
wait(100+random(500));
until i=28

End;

and here's a banking part (if you are alking

Procedure bank;
Var
k:integer;
begin
k:=0;
openbankfast('veb');
repeat
wait(500);
if k=30 then
bank;
until bankscreen
//depositall;
wait(200);
withdraw(0,0,0);
end;

Search around and look up what each thing means if you have questions about each item. Between what you see here, and in the suggested tutorials above, you should have a working script!