SRL Archive - OSR Help

hey everyone :) little help needed please


jamesss

2012-06-21 14:15:05

hello everyone, new to scripting, just got a few questions about my script i quickly wrote

Program BasicScriptTutorial;
{$DEFINE SMART}
{$i srl/srl.simba}




Procedure DeclarePlayers;
begin
HowManyPlayers := 1
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :=''; // Enter your username/email.
Players[0].Pass :=''; //Enter Your password.
Players[0].Active := True; //change to False if you don't wanna use this char.
Players[0].Pin := ''; //enter your bank pin(if you have one).
end;

procedure attack;
var x, y: integer;
begin
repeat
if FindObj(x, y, 'ttack', 1907998, 10) then
Mouse(x, y, 0, 0, false);
ChooseOption('ttack');
repeat
wait(5000+random(600));
Until not IsUpText('ew') or (InvFull);
until(InvFull);
end;

begin
attack;
end.

yeah i know the codes all over the place but i used Script down your first rs tree by griff (thanks great tutorial) and edited it to see what i can get to work :P and also watched YoHoJo videos (thank you too :D) but few things i wanna ask:

1:dropping whole inv or even certain items?
2: when i stop the script and play again it closes smart and opens it again but i need it to just start only after editing it
3: why does my mouse move around alot then ages after it finds the rat :P

sorry the post is so long :( just need to get a few things clear lol.

edit: its for rats in lummy swamp… the dark bit :P

Based Lord

2012-06-21 15:33:08

The following is needed to setup SMART correctly
You need it in your main loop
 
begin
Smart_Server := 44;//This will stop it from closing the window
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;

SetupSRL;
DeclarePlayers;
LoginPlayer;

Attack;
end.

jamesss

2012-06-21 16:04:36

ah yeah i guess that may help :P atm just tryna learn about DTM and that but i cant seem to do it right :( nothing works for me, hmph :(

Mr. Doctor

2012-06-21 16:21:07

1: DropAll; Drops everything in your inventory.

Or you drop items in certain ranges (Like 3rd inventory spot to your 12th) using this procedure.


Procedure DropStuff(From,Too:integer);
var L :integer;
begin
For L := From to Too do
DropItem(L);
end;

Or you can get a DTM of an item and do a repeat drop until it doesn't find the DTM in the inventory anymore.

2: I'm not sure.

3: I know it has something to do with those two repeats.


repeat
wait(5000+random(600));
Until not IsUpText('ew') or (InvFull);
until(InvFull);

I'm not sure what this does. What is it waiting for?

If you're waiting for the rat to die then use

Until(Not(InFight));

jamesss

2012-06-22 10:42:15

right the DTM one i cant seem to get to work :( dtm's are such a pain lol, but thank you so much! definatly helped me alot :]

Tniffoc

2012-06-22 14:02:17

From: jamesss
right the DTM one i cant seem to get to work :( dtm's are such a pain lol, but thank you so much! definatly helped me alot :]


This function may be of great use to you. Also, check out YoHoJo's DTM tutorial on youtube. His channel is YoHoJoSRL. Good luck with your learning!

http://docs.villavu.com/srl-5/inventory.html#dropitemsbyidentifier