SRL Archive - RS3 Script Requests

Script Help Please?


downwindchubs

2013-01-17 11:38:55

Ok so I have this so far, but I want to know if their was a way to make it constantly type rather than just in between points, thanks

p.s im a major noob so please use small words ;) <3





{$DEFINE SMART}
{$i SRL/SRL.simba}
{$i SPS/SPS.simba}
{$i SRL/SRL/Misc/Debug.simba}
{$I SRL/SRL/Misc/Online.simba}


procedure WalkAroundGE;
var
First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth, Tenth, Eleventh:TPoint;
begin
SPS_Setup(RUNESCAPE_SURFACE, ['10_5', '10_6', '10_7', '11_5', '11_6', '11_7']);
First := Point(4420, 2767);
Second := Point(4457, 2770);
Third := Point(4485, 2786);
Fourth := Point(4461, 2814);
Fifth := Point(4464, 2845);
Sixth := Point(4503, 2843);
Seventh := Point(4531, 2841);
Eighth := Point(4504, 2793);
Ninth := Point(4499, 2765);
Tenth := Point(4464, 2759);
Eleventh := Point(4425, 2762);
repeat
SPS_WalkToPos(First);
typesend('GLOW3:Message);
SPS_WalkToPos(Second);
typesend('GLOW3:Message');
SPS_WalkToPos(Third);
typesend('GLOW3:Message');
SPS_WalkToPos(Fourth);
typesend('GLOW3:Message');
SPS_WalkToPos(Fifth);
typesend('GLOW3:Message');
SPS_WalkToPos(Sixth);
typesend('GLOW3:Message');
SPS_WalkToPos(Seventh);
typesend('GLOW3:Message');
SPS_WalkToPos(Eighth);
typesend('GLOW3:Message');
SPS_WalkToPos(Ninth);
typesend('GLOW3:Message!');
SPS_WalkToPos(Tenth);
typesend('GLOW3:Message');
until(false);
end;

Ian

2013-01-17 12:14:06

You could make talking into a separate procedure and then call it in between the walking. I'm not sure if that's what you mean though.

And btw I typed this in my browser so not sure how the formatting will work, this is just to give you the general idea.

procedure SayStuff;
begin
repeat
SayMessage; //This is where you put your talking line
wait; //This is where you use a randomized wait between messages
sayMessage;
ect... //NOT AN ACTUAL COMMAND! Just copy your message and wait downwards until you're out of things to say
until (not IsMoving); //This is an actual thing, you can use this
end;

procedure WalkPlaces;
begin
WalkPlace1; //Tis is where you put your walking line (1st point)
SayStuff; // This is the name of your talking procedure.
WalkPlace2; // 2nd point
SayStuff;
WalkPlace3;
SayStuff;
WalkPlace4;
SayStuff;
WalkPlace5;
SayStuff;
WalkPlace6;
SayStuff;
end;

Hope that wasn't too confusing :p

Kevin

2013-01-17 12:42:24

When you say constantly type, do you mean to have it say something at a set interval and not just once per point? Or is once between each point all you mean?

downwindchubs

2013-01-17 13:05:06

From: nivek1989
When you say constantly type, do you mean to have it say something at a set interval and not just once per point? Or is once between each point all you mean?


I mean so it is typing all the time, and not just once per point :P

Kevin

2013-01-17 13:21:07

In that case… Stealing @BMW's skeleton code and editing also in my browser:


const
TimeBetweenTyping = 1000; //Milliseconds, so this is 1 second

var
TimeLastSent: Integer;

procedure SayStuff;
begin
repeat
repeat
until ((not IsMoving) or (TimeFromMark(TimeLastSent) > TimeBetweenTyping));//Basically a wait until time last sent (or should be done running entirely)
if(TimeFromMark(TimeLastSent) > TimeBetweenTyping)then
begin
MarkTime(TimeLastSent);
SayMessage; //This is where you put your talking line
end;
until (not IsMoving); //Not IsMoving occurs twice so we stop looping the moment we stop moving so we can run with the next command
end;

procedure WalkPlaces;
begin
WalkPlace1; //Tis is where you put your walking line (1st point)
SayStuff; // This is the name of your talking procedure.
WalkPlace2; // 2nd point
SayStuff;
WalkPlace3;
SayStuff;
WalkPlace4;
SayStuff;
WalkPlace5;
SayStuff;
WalkPlace6;
SayStuff;
end;

downwindchubs

2013-01-17 13:41:35

I get this "[Error] (22:7): Unknown identifier 'SayMessage' at line 21
Compiling failed."

Ian

2013-01-17 13:49:22

That is because the code we gave you was only a template, you need to switch in your own things. I did tell you what to switch and where though.

For example,

SayMessage
becomes
typesend('GLOW3:Message');

downwindchubs

2013-01-17 14:06:52

sorry i really dont understand this stuff ahaha, this is the first script ive ever tried to make :L

downwindchubs

2013-01-17 14:14:09

From: BMWxi
That is because the code we gave you was only a template, you need to switch in your own things. I did tell you what to switch and where though.

For example,

SayMessage
becomes
typesend('GLOW3:Message);


Ok I think ive done most stuff but now Im getting "[Error] (18:35): Closing parenthesis expected at line 17
Compiling failed."

Ian

2013-01-17 14:15:47

From: downwindchubs
sorry i really dont understand this stuff ahaha, this is the first script ive ever tried to make :L


This Line types your message
typesend('GLOW3:Message');


Wherever the script has
SayMessage


Replace it with
typesend('GLOW3:Message');

The closing Parenthesis error is because I copy and pasted the message from your first Typesend thing in the OP and you forgot one. Try again with a ' added before the bracket.

The Killer

2013-01-17 14:22:51

From: downwindchubs
sorry i really dont understand this stuff ahaha, this is the first script ive ever tried to make :L


umm, come on skype and I'll help you with everything.


Can be shorted to:
For i := 1 to 11 do
Sps_WalkToPos(i);
Typesend('Glow3:Message');
Bare in mind you would need to name the paths 1 to 11

edit: he wants to talk while using walktopos

downwindchubs

2013-01-17 14:24:59

From: BMWxi
This Line types your message
typesend('GLOW3:Message');


Wherever the script has
SayMessage


Replace it with
typesend('GLOW3:Message');

The closing Parenthesis error is because I copy and pasted the message from your first Typesend thing in the OP and you forgot one. Try again with a ' added before the bracket.

its on this line though? until ((not IsMoving) or (1000(1000) > 1000)); //Basically a wait until time last sent (or should be done running entirely)

Ian

2013-01-17 14:26:46

From: downwindchubs
its on this line though? until ((not IsMoving) or (1000(1000) > 1000)); //Basically a wait until time last sent (or should be done running entirely)


You have one too many parentheses, delete one before the not IsMoving.

Also what is the ((1000(1000) > 1000) for? I think you need to mark the time using MarkTime then use TimeFromMark to decide when to finish

Kevin

2013-01-17 14:27:55

From: The Killer
umm, come on skype and I'll help you with everything.


Can be shorted to:
For i := 1 to 11 do
Sps_WalkToPos(i);
Typesend('Glow3:Message');
Bare in mind you would need to name the paths 1 to 11


Agreed, come on skype. This is shorter, sure but you'll need to call the dedicated procedure I added instead of directly calling TypeSend if you want it to happen constantly and not once per point. :)

Also, some includes should be added (on the first couple lines of the program) I suppose:

{$DEFINE SMART}//or SMART8
{$i SRL/srl.simba}

DannyRS

2013-01-17 14:39:54

Would this not work



MyPath: Array of TPoint;
SetLength(MyPath, 3);

MyPath[0]:= [Point(0, 0)]
MyPath[1]:= [Point(1, 1)]
MyPath[2]:= [Point(2, 2)]

For i := 0 to 2 do
Begin
Sps_WalkToPos(MyPath[i]);
Typesend('Glow3:Message');
End;


downwindchubs

2013-01-17 14:44:12

From: BMWxi
You have one too many parentheses, delete one before the not IsMoving.

Also what is the ((1000(1000) > 1000) for? I think you need to mark the time using MarkTime then use TimeFromMark to decide when to finish


ok now i get [Error] (35015:1): Unexpected end of file at line 35014
Compiling failed. -.-

Kevin

2013-01-17 14:44:40

That would work, but it would only send 1 message per point walked. He wants the possibility of more than 1 per point, so mine should* do it based off a timer as opposed to a count per point.

Edit: That also means some points could possibly have separate amounts of messages depending on far apart each was.

The Killer

2013-01-17 14:51:15

From: DannyRS
Would this not work



MyPath: Array of TPoint;
SetLength(MyPath, 3);

MyPath[0]:= [Point(0, 0)]
MyPath[1]:= [Point(1, 1)]
MyPath[2]:= [Point(2, 2)]

For i := 0 to 2 do
Begin
Sps_WalkToPos(MyPath[i]);
Typesend('Glow3:Message');
End;


Wouldn't need to have them as paths, could just use as single points :p
and we're all off what he wants.
he wants to talk whilst walking instead of inbetween points :P, I said i'd help in 10

Kevin

2013-01-17 14:51:17

Down: Could you upload (In ]SIMBA] tags) your entire current script?

downwindchubs

2013-01-17 14:52:53



{$DEFINE SMART}
{$i SRL/SRL.simba}
{$i SPS/SPS.simba}
{$i SRL/SRL/Misc/Debug.simba}
{$I SRL/SRL/Misc/Online.simba}

const
TimeBetweenTyping = 1000; //Milliseconds, so this is 1 second

var
TimeLastSent: Integer;

procedure SayStuff;
begin
repeat
repeat
until (not IsMoving) or (TimeFromMark(TimeLastSent) > TimeBetweenTyping);//Basically a wait until time last sent (or should be done running entirely)
if(TimeFromMark(TimeLastSent) > TimeBetweenTyping)then
begin
MarkTime(TimeLastSent);
Typesend('Glow3:Message'); //This is where you put your talking line
end;
until (not IsMoving); //Not IsMoving occurs twice so we stop looping the moment we stop moving so we can run with the next command
end;

procedure WalkPlaces;

begin
Point(4420, 2767);
SayStuff;
Point(4457, 2770);
SayStuff;
Point(4461, 2814);
SayStuff;
Point(4503, 2843);
SayStuff;
Point(4504, 2793);
SayStuff;
Point(4464, 2759);
SayStuff;
end;


Olly

2013-01-17 14:56:59

procedure WhileWalking;
begin
TypeSend('GLOW3:Message');
end;

procedure Walk;
var
SPSPts: TPointArray;
i: Integer;
begin
SetArrayLength(SPSPts, 10);
SPSPts := [Point(1,1), Point(1,1), Point(1,1), Point(1,1), Point(1,1), Point(1,1), Point(1,1), Point(1,1), Point(1,1), Point(1,1)];

for i := 0 to high(SPSPts) do
if SPS_WalkToPos(SPSPts[i]) then
Writeln('Walked to SPS point ('+IntToStr(i)+') which was point'+ToStr(SPSPts[i]));
end;

begin
SetupSRL
SRL_Procs[SRL_Antiban] := @Walk;
SPS_Setup(blah blah blah);

repeat
Walk;
until (false);
end.

Providing you can set everything else up this should walk around the ge typing while walking

DannyRS

2013-01-17 14:57:48

From: The Killer
Wouldn't need to have them as paths, could just use as single points :p
and we're all off what he wants.
he wants to talk whilst walking instead of inbetween points :P, I said i'd help in 10


i made em points

TPoint;

that would simulate talking while walking

The Killer

2013-01-17 15:09:41

From: DannyRS
i made em points

TPoint;

that would simulate talking while walking

Yeah I phrased that badly, I mean

MyPath[0]:= [Point(0, 0)]
MyPath[1]:= [Point(1, 1)]
MyPath[2]:= [Point(2, 2)]
is the same as
 
MyPath := [Point(0, 0), Point(1, 1), Point(2,2)];

downwindchubs

2013-01-17 15:10:32

From: Ollybest
procedure WhileWalking;
begin
TypeSend('GLOW3:Message');
end;

procedure Walk;
var
SPSPts: TPointArray;
i: Integer;
begin
SetArrayLength(SPSPts, 10);
SPSPts := [Point(1,1), Point(1,1), Point(1,1), Point(1,1), Point(1,1), Point(1,1), Point(1,1), Point(1,1), Point(1,1), Point(1,1)];

for i := 0 to high(SPSPts) do
if SPS_WalkToPos(SPSPts[i]) then
Writeln('Walked to SPS point ('+IntToStr(i)+') which was point'+ToStr(SPSPts[i]));
end;

begin
SetupSRL
SRL_Procs[SRL_Antiban] := @Walk;
SPS_Setup(blah blah blah);

repeat
Walk;
until (false);
end.

Providing you can set everything else up this should walk around the ge typing while walking



didnt work :( walked around but didn't type :(

Kevin

2013-01-17 15:12:28

From: Ollybest

Providing you can set everything else up this should walk around the ge typing while walking

But isn't that still only 1 message per point he walks too?

But like Olly has, you (downwindchub) will need a "main" method. It's a method that starts the whole program, without it, your script doesn't know where to start. After what you currently have, you should add:

begin
SetupSRL
SPS_Setup(blah blah blah);

repeat
WalkPlaces;
until (false);
end.

Notice the lack of procedure declaration and how this end has a period instead of semicolon? (It should also be the last thing in your script).

downwindchubs

2013-01-17 15:22:18


{$DEFINE SMART}
{$i SRL/SRL.simba}
{$i SPS/SPS.simba}
{$i SRL/SRL/Misc/Debug.simba}
{$I SRL/SRL/Misc/Online.simba}

const
TimeBetweenTyping = 1000; //Milliseconds, so this is 1 second

var
TimeLastSent: Integer;

procedure SayStuff;
begin
repeat
repeat
until (not IsMoving) or (TimeFromMark(TimeLastSent) > TimeBetweenTyping);//Basically a wait until time last sent (or should be done running entirely)
if(TimeFromMark(TimeLastSent) > TimeBetweenTyping)then
begin
MarkTime(TimeLastSent);
Typesend('Glow3:Message'); //This is where you put your talking line
end;
until (not IsMoving); //Not IsMoving occurs twice so we stop looping the moment we stop moving so we can run with the next command
end;

procedure WalkPlaces;

begin
Point(4420, 2767);
SayStuff;
Point(4457, 2770);
SayStuff;
Point(4461, 2814);
SayStuff;
Point(4503, 2843);
SayStuff;
Point(4504, 2793);
SayStuff;
Point(4464, 2759);
SayStuff;
end;
begin
SetupSRL
SPS_Setup(RUNESCAPE_SURFACE, ['10_5', '10_6', '10_7', '11_5', '11_6', '11_7']);

repeat
WalkPlaces;
until (false);
end.

OK it types but it doesn't move :/

Kevin

2013-01-17 15:31:03

To "fix" the portion I wrote, change each
Point(num1, num2);
to
SPS_WalkToPos(Point(num1, num2));

to "fix" his, Replace:
Writeln('Walked to SPS point ('+IntToStr(i)+') which was point'+ToStr(SPSPts[i]));
with
WhileWalking;

Olly

2013-01-17 16:01:59

My bad, change "SRL_Procs[SRL_Antiban] := @Walk;" to "SRL_Procs[SRL_Antiban] := @WhileWalking;"

downwindchubs

2013-01-17 16:29:41

From: Ollybest
My bad, change "SRL_Procs[SRL_Antiban] := @Walk;" to "SRL_Procs[SRL_Antiban] := @WhileWalking;"



YAY IT WORKS :3


thank you all for the help :)

Olly

2013-01-17 16:45:05

From: nivek1989
But isn't that still only 1 message per point he walks too?

But like Olly has, you (downwindchub) will need a "main" method. It's a method that starts the whole program, without it, your script doesn't know where to start. After what you currently have, you should add:

begin
SetupSRL
SPS_Setup(blah blah blah);

repeat
WalkPlaces;
until (false);
end.

Notice the lack of procedure declaration and how this end has a period instead of semicolon? (It should also be the last thing in your script).


He didn't exactly ask for multiple messages though, could easily be added though.

Kevin

2013-01-17 16:54:27

From: downwindchubs
I mean so it is typing all the time, and not just once per point :P


Doesn't this mean (at least possibly) multiple messages, although not necessarily a flat count of messages per point?

Also, while I have your attention, what exactly does:
SRL_Procs[SRL_Antiban] := @SomeProcedure;
do? Some sort of calling of the passed function pointer however often?

downwindchubs

2013-01-17 17:30:02

From: nivek1989
Doesn't this mean (at least possibly) multiple messages, although not necessarily a flat count of messages per point?

Also, while I have your attention, what exactly does:
SRL_Procs[SRL_Antiban] := @SomeProcedure;
do? Some sort of calling of the passed function pointer however often?


Yeah I originally planned on having different messages but its not necessary, and im have no idea sorry, it was already in the template @Ollybest provided

Olly

2013-01-17 18:38:49

From: downwindchubs
Yeah I originally planned on having different messages but its not necessary, and im have no idea sorry, it was already in the template @Ollybest provided


easily done, change the i var to a global var then call it in the speak procedure

var 
i: integer;

procedure WhileWalking;
var
Message: String;
begin
case i of
0: Message := 'wave1: lets type this!';
1: Message := 'wave2: lets type this!';
2: Message := 'wave3: lets type this!@';
3: Message := 'wave1: lets type this!!!';
4: Message := 'wave1: lets type this!!!!!';
5: Message := 'wave1: lets type this!!!!!!';
else //can add more or remove if you want depending on how much walking etc you do
Message := 'wave1: and this';
end;

TypeSend(Message);
end;

procedure Walk;
var
SPSPts: TPointArray;
begin
SetArrayLength(SPSPts, 10);
SPSPts := [Point(1,1), Point(1,1), Point(1,1), Point(1,1), Point(1,1), Point(1,1), Point(1,1), Point(1,1), Point(1,1), Point(1,1)];

for i := 0 to high(SPSPts) do
if SPS_WalkToPos(SPSPts[i]) then
Writeln('Walked to SPS point ('+IntToStr(i)+') which was point'+ToStr(SPSPts[i]));
end;

From: nivek1989
Doesn't this mean (at least possibly) multiple messages, although not necessarily a flat count of messages per point?

Also, while I have your attention, what exactly does:
SRL_Procs[SRL_Antiban] := @SomeProcedure;
do? Some sort of calling of the passed function pointer however often?


It calls the function while waiting for flag (fflag(dist)).