SRL Archive - SRL Archives

Some Usefull Procs/Funcs!!!


P1nky

2008-09-04 23:07:12

hey Dudes/Chicks
here some funcs/procs i usaully use for my scripts, made by me, as some people have problems of making anti-ban procs, so here it is it be great if added to srl.
since antiban.scar isnt really lively with procs/funcs
and some other extra stuff which is usefull.
Check it oUt(simple but usefull):

thanks turbo.


{*******************************************************************************
procedure RandomCompass;
By: P1nky (really common used)
Description: Will move the compass in any random direction.
*******************************************************************************}


Procedure RandomCompass; //common 1 should be added to srl.
Begin
If (Not(LoggedIn)) Or (Not(Players[CurrentPlayer].Active)) Then
NextPlayer(False);
Case Random(10) Of
0: MakeCompass('N');
1: MakeCompass(IntToStr(Random(360)));
2: MakeCompass('S');
3: MakeCompass(IntToStr(Random(180)));
4: MakeCompass('E');
5: MakeCompass(IntToStr(Random(360)));
6: MakeCompass('W');
7: SetAngle(True);
End;
End;


{*******************************************************************************
procedure RandomArrows;
By: P1nky
Description: it will move the screen N/W/E/S randomnly with using the Arrows *up/right/left arrow on keyboard.*
*******************************************************************************}

Procedure RandomButton;
Begin
If Not (LoggedIn) Or Not (Players[CurrentPlayer].Active) Then
NextPlayer(false);
Case Random(3) Of
0:
Begin
KeyDown(VK_Left);
wait(Random(600) + 500);
KeyUp(VK_Left);
End;
1:
Begin
KeyDown(VK_Right);
wait(Random(600) + 500);
KeyUp(VK_Right);
End;
2:
Begin
KeyDown(VK_Up);
wait(Random(600) + 500);
KeyUp(VK_Up);
End;
End;
End;



{*******************************************************************************
procedure Congrats;
By: P1nky
Description: Detects if you have grew a level , in any skill.
*******************************************************************************}

Procedure Grats;
Begin
If Not (LoggedIn) Or Not (Players[CurrentPlayer].Active) Then
NextPlayer(false);
If (FindBlackChatMessage('Congratulations')) Or
(FindBlackChatMessage('you just advance')) Or
InChat('Congratulations') Or InChat('just advance') Or InChat('congratulations,') Then
Begin
Writeln('Gained a levled!!!');
Begin
Case Random(18) Of
0: TypeSend('woot finnally LEVELED!!');
1: TypeSend('muwahah lvled');
2: TypeSend('leveled yay me!');
3: TypeSend('woot i lvled :)');
4: TypeSend('omg.. i didnt even know i just leveld');
5: TypeSend('yay me');
6: TypeSend('w00t grats');
7: TypeSend('Dang!');
8: TypeSend('fireworks@!');
9: TypeSend('yay leveld!');
10: TypeSend('woot didnt notice since lagged lol');
11: Typesend('good i just leveld wc');
12: TypeSend('yay!');
13: TypeSend('Hleveled');
14: TypeSend('.lvld just now guys grats me jk');
15: TypeSend('lol');
16: TypeSend('lol...');
17: TypeSend('fireworkz');
End;
End;
writeln('You Have Just Gained A Leveled CONGRATz~!');
End;
End;



{*******************************************************************************
procedure CheckLastSlot;
By: BH (i think) but edited by P1nky
Description: will check the last slot of invo to see if the item still exists
invfull , sometimes failed for me so i used this worked fine.
*******************************************************************************}
Function CheckInv(ItemColor:integer): boolean;
Begin
If Not (LoggedIn) Or Not (Players[CurrentPlayer].Active) Then
NextPlayer(false);
Begin
gametab(4);
If Not FindColor(x, y, ItemColor, 700, 441, 702, 443) Then
Begin
Result := true;
End Else
Result := false;
End;
End;

thats all for now, going to see if i can edit/make new functions

btw creds to method to help me a bit , to clarify some stuff for me

thanks!

bullzeye95

2008-09-04 23:12:35

Why do you use tab instead of two spaces?

P1nky

2008-09-04 23:14:59

lol i used a pascal standerizer for it

:p

i got a bad habit, i do the script like so messy, and than in end im so lazy to standard it by myself so i use a pascal standerizer :)

turbobk

2008-09-04 23:24:09

{*******************************************************************************
Procedure RandomCompass;
By: P1nky (Really commonly used)
Description: Will move the compass in any random direction.
*******************************************************************************}


Procedure RandomCompass; //common 1 should be added to srl.
Begin
If (Not(LoggedIn)) Or (Not(Players[CurrentPlayer].Active)) Then
NextPlayer(False);
Case Random(10) Of
0: MakeCompass('N');
1: MakeCompass(IntToStr(Random(360)));
2: MakeCompass('S');
3: MakeCompass(IntToStr(Random(180)));
4: MakeCompass('E');
5: MakeCompass(IntToStr(Random(360)));
6: MakeCompass('W');
7: SetAngle(True);
End;
End;

Maybe change it to that,
Because no one always stops there compass on a specific direction, that will be more random. :)

P1nky

2008-09-04 23:27:47

hm good catch :P ill edit right now, and credit you thanks turbo.

kinda stupid of me did it for randombutton but not for randomcompass heh?
lol

thnkx once again

turbobk

2008-09-04 23:29:26

From: ~~Joker~~
hm good catch :P ill edit right now, and credit you thanks turbo.

kinda stupid of me did it for randombutton but not for randomcompass heh?
lol

thnkx once again


Haha its cool,
No problem.. Anytime :p


{it will move the screen N/W/E/S randomnly.}

Change the description to my one, I fixed it up for you :p

P1nky

2008-09-04 23:34:38

ah another good catch lol
:p kay's

Edit:done

turbobk

2008-09-04 23:37:01

From: ~~Joker~~
ah another good catch lol
:p kay's

Edit:done


Now you have 2 Descriptions lol! ::rolleyes:

P1nky

2008-09-04 23:45:03

goodness you stalker lol :P
thanks once again!!!! ill just rep you lol.

turbobk

2008-09-04 23:52:42

From: ~~Joker~~
goodness you stalker lol :P
thanks once again!!!! ill just rep you lol.


Hahaha, thanks alot man, appreciate it. :)

Nava2

2008-09-05 08:14:27

{*******************************************************************************
procedure CheckLastSlot;
By: BH (i think) but edited by P1nky
Description: will check the last slot of invo to see if the item still exists
invfull , sometimes failed for me so i used this worked fine.
*******************************************************************************}
Function CheckInv(ItemColor:integer): boolean;
Begin
If Not (LoggedIn) Or Not (Players[CurrentPlayer].Active) Then
NextPlayer(false);
Begin
gametab(4);
If Not FindColor(x, y, ItemColor, 700, 441, 702, 443) Then
Begin
Result := true;
End Else
Result := false;
End;
End;

Should be:

Function CheckLastSlot: boolean;

var
IB : TBox;

Begin
If Not (LoggedIn) then Exit;
GameTab(4);
GetInvItemBounds(28, IB);
Result := FindColor(x, y, 65536, IB.x1, IB.y1, IB.x2, IB.y2);
End;

Hope I helped.

BobboHobbo

2008-09-05 09:22:27

more like: Some N00b procs/Funcs :D Jks.

ShowerThoughts

2008-09-05 09:58:34

Hey, I will edit this post a few times or not anymore but:

2 things
1.
Listen people only see the name of a proc or func, when they do ctrl + space.
they will see RandomCompass they think compass changes… so don't add setangle;
2.
In general
Look don't add stuff like

If (Not(LoggedIn)) Or (Not(Players[CurrentPlayer].Active)) Then
It can work..
but in general it's nor smart because when people use it and it does nothing they don't get why. if they want to do it only logged in then let them do that in THEIR script.
This could have caused a few probs in the past.
Let the failsafes away, let scripters add them. only if it is highlevel important needed.

also
Procedure RandomCompass; //common 1 should be added to srl.
Begin
If (Not(LoggedIn)) Or (Not(Players[CurrentPlayer].Active)) Then
NextPlayer(False);
Case Random(10) Of
0: MakeCompass('N');
1: MakeCompass(IntToStr(Random(360)));
2: MakeCompass('S');
3: MakeCompass(IntToStr(Random(180)));
4: MakeCompass('E');
5: MakeCompass(IntToStr(Random(360)));
6: MakeCompass('W');
End;
End;

To:

Procedure RandomCompass; //common 1 should be added to srl.
Begin
MakeCompass(IntToStr(Random(360)));
End;

3Garrett3

2008-09-05 17:00:02

Make the level gained one a Function and make it return true if it levels up, false if not.

And don't make it say something every time it levels up..

Waddo

2008-09-05 19:32:21

11: Typesend('good i just leveld wc');


erm what if where mining?

P1nky

2008-09-05 19:59:47

k thanks for feedback

and waddo
i forgot to edit that 1. -.- lol

Santa_Clause

2008-09-05 21:09:50

Function CheckInv(ItemColor : Integer): Boolean;
Begin
If Not(LoggedIn) Or Not(Players[CurrentPlayer].Active) Then
NextPlayer(False);
Gametab(4);
If Not(FindColor(x, y, ItemColor, 700, 441, 702, 443)) Then
Result := True;
End;

You can just use ItemExists too.

P1nky

2008-09-05 23:43:26

orrr that lol :p

yeah i noticed that today morning lol, though we can use CheckInv too :P