SRL Archive - SRL Archives

Check If Skill Is Flashing | Function SkillFlashing: Boolean


Nadeem

2009-05-13 04:34:42

Hi,

Credits to zasz for the idea.


[HOW TO USE:]

var
Skills: TStringArray;

SkillFlashing('fir', True, Skills); // This will only check if firemaking is flashing, and click it, wait 2000 - 5000ms then close window, and return the skill string in array Skills.

SkillFlashing('fir', False, Skills); // This will only check if firemaking is flashing, not click, and return the skill string in array Skills.

SkillFlashing('all', True, Skills); // This will check all skills, if flashing, then click, wait 2000-5000ms and close window, and return ALL flashing skills into the array Skills.

SkillFlashing('all', False, Skills); // This will check all skills, not click, and return ALL flashing skills into the array Skills.
If you don't get the idea on how to use it, let me know and I'll explain even more :P

[CURRENT SPEED:]
SkillFlashing; v3.0:

[I]These were all done with the mouse starting at left top corner of RS screen.[/I]

[U]Check ALL Skills, AND return all array of skills flashing, not clicking, one scroll:[/U]
> 454
> fir
> woo
> sum
> Successfully executed

[U]Check ALL Skills, AND return all array of skills flashing, not clicking, two scrolls:[/U]
> 931
> fir
> woo
> sum
> Successfully executed


[U]Check ALL Skills, AND return all array of skills flashing, clicking all with random 2k-5k ms each wait, two scrolls:[/U]
> 11302
> fir
> woo
> sum
> Successfully executed

[U]Checking One Skill, not clicking:[/U]
> 0
> fir
> Successfully executed

[U]Checking One Skill, not clicking:[/U]
> 16
> woo
> Successfully executed

[U]Checking One Skill, not clicking, scroll once:[/U]
> 410
> sum
> Successfully executed

[U]Checking One Skill, clicking:[/U]
> 3894
> fir
> Successfully executed

[THE FUNCTION:]

{×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
× Function : SkillFlashing: Boolean; | v3.1
× Author : Nadeem
× Desc. : Check if skill flashing, if C = True, then click it.
×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××}
function SkillFlashing(Skill: string; C: Boolean; var F: TStringArray): Boolean;
var
X, Y, I, II, SID, HH, MS, TS: Integer;
S: string;
Skills: TStringArray;
Temp, Tempora: TIntegerArray;
Coords: TPointArray;
begin
Gametab(2);
MS := MouseSpeed;
MouseSpeed := 50;
SID := 24;
Result := False;
Coords := [Point(559,249), Point(569,266), Point(559,299), Point(573,329),//03
Point(566,379), Point(569,399), Point(589,433), Point(629,239),//07
Point(623,283), Point(609,309), Point(629,339), Point(623,373),//11
Point(623,393), Point(629,423), Point(669,232), Point(663,269),//15
Point(673,309), Point(679,339), Point(669,379), Point(679,403),//19
Point(679,423), Point(569,433), Point(623,433), Point(663,439)];
Skills := ['att', 'str', 'def', 'ran', 'pra', 'mag', 'run', 'hit', 'agi', //08
'her', 'thi', 'cra', 'fle', 'sla', 'min', 'smi', 'fis', 'coo', //17
'fir', 'woo', 'far', 'con', 'hun', 'sum', 'all']; //24
HH := High(Skills);
for I := 0 to HH do
begin
if (Skill = Skills[I]) then
begin
SID := I;
Break;
end;
end;
if (SID >= 21) and (SID <> 24) and (GetColor(673, 433) <> 12427653) then
begin
MMouse(719, 413, 10, 17);
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, True);
end else if (GetColor(619, 243) <> 143297) then
begin
MMouse(719, 243, 10, 17);
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, True);
end;
if (SID <> 24) then
begin
TS := 1 shl 16;
Tempora := [GetColor(Coords[SID].x, Coords[SID].y)];
if (Tempora[0] <> TS) then
begin
if C then
begin
Mouse(Coords[I].x, Coords[I].y, 6, 6, True);
Wait(RandomRange(2000, 5000));
CloseWindow;
end;
S := Skills[SID];
Result := True;
end;
end else
begin
Tempora := GetColors(Coords);
if (GetColor(673, 433) <> 12427653) then
begin
MMouse(719, 413, 10, 17);
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, True);
end;
SetLength(Temp, 3);
for I := 0 to 2 do
Temp[I] := GetColor(Coords[I+21].x, Coords[I+21].y);
Tempora := CombineIntArray(Tempora, Temp);
HH := High(Tempora);
for I := 0 to HH do
begin
if (I >= 21) and (I <= 23) then Continue;
if (I <= 20) then
II := I
else
II := I-3;
if (II = 22) then
TS := 789517
else
TS := 1 shl 16;
if (Tempora[I] <> TS) then
begin
if C then
begin
if (II < 21) and (GetColor(619, 243) <> 143297) then
Mouse(Coords[II].x, Coords[II].y - RandomRange(30,40), 6, 6, True)
else
Mouse(Coords[II].x, Coords[II].y, 6, 6, True);
Wait(RandomRange(2000, 5000));
CloseWindow;
end;
if (S <> '') then
S := S + ',' + Skills[II]
else
S := Skills[II];
Result := True;
end;
end;
end;
F := Explode(',', S);
MouseSpeed := MS;
end;

[UPDATES:]

[[I]v3.0[/I]]
- Extremely Faster!
- Averaging 0ms - 10ms for single skill checking
- Averaging 375ms - 465ms for all skill checking with 1x scroll up or down
- Return skills flashing into a string array
- Clicks if told to on skill

[[I]v2.0[/I]]
- Extremely Fast!
- Averaging <150ms for all and single
- Returns skills flashing into an array
- Autocolors, its skill. So never will anyone have to change any colors up, because there are no colors to change :P

[[I]v1.5[/I]]
- TBox changes
- Size shifting

~NS

mrpickle

2009-05-13 04:46:26

Hah! Nice, Except I can't think of a place to use something like this? except for anti-ban?

Edit: Nvm! Antiban is what it's for. Did not read the request page xD

Nadeem

2009-05-13 04:51:15

haha yes :P As far as i know this will probably only good for anti-ban, unless someone has a very creative imagination :D



~NS

Mystic

2009-05-13 06:01:11

Wow! Nice function.. may put it in my new script. ;)
Good job Nadeem :D

mormonman

2009-05-13 06:13:32

I'm glad you found a use for your abstractmotion function :D

Nadeem

2009-05-13 06:19:28

hahah Thank you! :D:D

Mystic

2009-05-13 07:41:17

Alright added, and credited. I'll pm you when it's out. :)
Good job! Thanks!

Edit: Found an error?
Line 507: [Error] (17386:33): Invalid number of parameters in script 
Here's line 507
MMouse(F[0], F[1], 20, 20, True);

Edit: Just Changed it from "MMouse" to "Mouse"
Works Great! Thanks! :)

Nadeem

2009-05-13 08:25:46

Hey! :)

Yes sorry! I mistyped :P TY!

BTW: TY all who repped++ and rated++ :D I shall now BEST++ you! :P


~NS

Floor66

2009-05-13 09:37:23

Fancy stuff :p
I like your AbstractMotion function ;)
This is my "DifferentMSColours" function, same as ur AbstractMotion but only checks the Main Screen:

{*******************************************************************************
Function DifferentMSColours: Boolean;
By: Floor66
Description: This function takes the colours of specific MainScreen points,
waits 100 + Random(50), takes new colours, and checks if the
colours are different from the first ones taken.
*******************************************************************************}

Function DifferentMSColours(MS_Points : Integer): Boolean;
Var
BeginColours, CheckColours : Array Of Integer;
ColorCoords : TPointArray;
i : Integer;
Begin
SetLength(ColorCoords, MS_Points);
SetLength(BeginColours, MS_Points);
SetLength(CheckColours, MS_Points);
For i := 0 To High(BeginColours) Do
Begin
ColorCoords[i].x := MSCX + Random(50);
ColorCoords[i].y := MSCY + Random(50);
BeginColours[i] := GetColor(ColorCoords[i].x, ColorCoords[i].y);
End;
Wait(100 + Random(50));
For i := 0 To High(CheckColours) Do
Begin
CheckColours[i] := GetColor(ColorCoords[i].x, ColorCoords[i].y);
If BeginColours[i] <> CheckColours[i] Then
Result := True;
End;
End;

I use it with this and since clicking objects/NPC's doesn't give a flag on the MM anymore it is so good.

{*******************************************************************************
Function CharacterMoving: Boolean;
By: Floor66
Description: This procedure incorporates the function DifferentMSColours to do
a check if the character is still moving. A real handy check when
doing something with walking!
*******************************************************************************}

Function CharacterMoving: Boolean;
Var
Checks, t : Integer;
Begin
Wait(1500 + Random(250));
Result := True;
MarkTime(t);
Repeat
If (Not DifferentMSColours(7)) Then
Inc(Checks);
If (Checks >= 2) Or (Not FlagPresent) Then
Result := False;
If TimeFromMark(t) >= (10 * 1000) Then
Result := False;
Until(Not Result);
End;

They work flawless for me ;)

Nadeem

2009-05-13 15:03:13

haha yes :) I was soo proud when you first released that :P Cuz it was an extension of my CheckMotion(); just alot more l77t :) And my AbstractMotion doesn't use get color, it is clearly based off bitmap finding through the use of a canvas :)



~NS

DeSnob

2009-05-13 15:04:35

From: Nadeem
haha yes :P As far as i know this will probably only good for anti-ban, unless someone has a very creative imagination :D



~NS


You can't forget..Itr can be used to check for level ups. :) Great addition to a proggy!

Nadeem

2009-05-13 19:28:19

Tru! hmmm… Gives me an idea :P

Should I make it return, what skill is flashing? So it will be easy to record a level up for the skills which is flashing…?



~NS

Dynamite

2009-05-13 20:17:09

From: Nadeem
Tru! hmmm… Gives me an idea :P

Should I make it return, what skill is flashing? So it will be easy to record a level up for the skills which is flashing…?



~NS


yeh that is what i was gonna suggest ;)
Do it! :p

T~M

Rich

2009-05-13 20:18:08

Sorry to put a shame to your glory...

Nadeem

2009-05-13 23:15:24

lol R1ch :P I know that, me and shuttleu both got the idea from the same thread :)



~NS

n3ss3s

2009-05-14 17:30:32

I will promise that using a lighter function that the abstract motion one for such a simple task will save loads of time.

Nadeem

2009-05-14 19:20:16

Yes, Thats what I've been thinking lately aswell… Your feedback makes it a stronger reason to change up a bit. Thanks!



~NS

Shuttleu

2009-05-14 19:47:31

From: n3ss3s
I will promise that using a lighter function that the abstract motion one for such a simple task will save loads of time.

like mine?

~shut

EDIT: http://villavu.com/forum/showthread.php?t=45367

Mystic

2009-05-15 02:50:53

From: Shuttleu
like mine?

~shut

EDIT: http://villavu.com/forum/showthread.php?t=45367


I'm still using Nadeem's :)

Nadeem

2009-05-15 02:52:16

lol ty Penguin :P

Anyway, My updated function is ALOT faster now :P average time rate for me was about 172ms. Read first post to see what was tweaked up.



~NS

Mystic

2009-05-15 02:58:21

Okay, I'm replacing it now. Ty :D

Shuttleu

2009-05-15 03:02:05

From: Penguin
I'm still using Nadeem's :)

read this
http://villavu.com/forum/showthread.php?p=568451#post568451

~shut

footballjds

2009-05-15 03:19:55

can't u just get rid of the all in your function???
just add in your case 'all' it'd do the same thing but be shorter/neater/less redundant ;)

Mystic

2009-05-15 03:26:59

From: Shuttleu
read this
http://villavu.com/forum/showthread.php?p=568451#post568451

~shut


Noes, I don't wanna ;)

Edit: Yay 100 posts :)

Nadeem

2009-05-15 03:32:41

@football: You think? Hmmm… I think thats a good idea actually!

@Penguin: 4 letters, LMFAO. oh wait… maybe 5… :)



~NS

Mystic

2009-05-15 03:35:05

Haha!, and thanks for the help it works 100%! :)

footballjds

2009-05-15 03:36:09

From: Nadeem
@football: You think? Hmmm… I think thats a good idea actually!

@Penguin: 4 letters, LMFAO. oh wait… maybe 5… :)



~NS


Glad u liked it!!! :D

Shuttleu

2009-05-15 04:28:21

From: Penguin
Noes, I don't wanna ;)

Edit: Yay 100 posts :)

but it explains why mine is better

~shut

Nadeem

2009-05-15 04:29:43

Yours IS better right now, but just wait till I release my re-code :P



~NS

Shuttleu

2009-05-15 04:32:10

lol have fun
then after i shall beat you once again XD

~shut

Nadeem

2009-05-15 07:06:22

There you go Shuttleu!! You just got pwned :P Averaging <150ms for all and single, with almost flawless accuracy :D + It autocolors itself! :)



~NS

Shuttleu

2009-05-15 10:32:40

mwaha
thanks
now i know ihow i can make mine even faster

~shut

Nadeem

2009-05-15 15:32:13

lol, I bet you can't :P This is already reaching like the min transition time it can go to, BUT if you do release some comparably fast, its most likely gunna be my ideas…:P, I got another trick up which will be even more faster :P



~NS

footballjds

2009-05-15 17:50:32

if u make it toooo fast it won't even be able to have time for the flash ;)
btw. use luminance :D
get color at a point that would change if it flashes.
wait(50);
get that point again.
check the lum. ;)

thats it….
simple enough eh? :D

Nadeem

2009-05-15 19:24:14

lolz, thats good to but wait(50) is still too fast, I found a stable point at 119ms on wait. But I know another way of making it faster :P

Edit: Actually I kinda like your idea football :) I might imply some in there. ty!



~NS

Shuttleu

2009-05-15 19:25:30

do you want to know one thing that is wrong with yours?

~shut

Nadeem

2009-05-15 19:31:26

How so Shuttleu? :P



~NS

Shuttleu

2009-05-15 19:40:26

when you search for the bottom 3 skills it doesnt scroll down
so it wont check the bottom 3 skills if they are flashing
which is what is saving you about 1-2 seconds

also you dont check to see if the levels are in the correct position

~shut

Nadeem

2009-05-15 19:51:39

Hmm… Yes I know about the 3 last skills, I realized SkillToCoords(); doesn't exactly do what I thought it should do :P

levels.. ??? lol what are you talking about?



~NS

Shuttleu

2009-05-15 19:54:26

here is from mine with just a single skill
Successfully compiled (2345 ms)
SRL Compiled in 16 msec
0
True
Successfully executed
Successfully compiled (2306 ms)
SRL Compiled in 16 msec
0
True
Successfully executed
Successfully compiled (2427 ms)
SRL Compiled in 0 msec
0
True
Successfully executed
Successfully compiled (2302 ms)
SRL Compiled in 16 msec
0
True
Successfully executed
Successfully compiled (2431 ms)
SRL Compiled in 16 msec
0
True
Successfully executed
Successfully compiled (2324 ms)
SRL Compiled in 0 msec
0
True
Successfully executed
Successfully compiled (2327 ms)
SRL Compiled in 15 msec
0
True
Successfully executed
Successfully compiled (2354 ms)
SRL Compiled in 16 msec
0
True
Successfully executed
Successfully compiled (2310 ms)
SRL Compiled in 15 msec
0
True
Successfully executed
Successfully compiled (2286 ms)
SRL Compiled in 16 msec
0
True
Successfully executed
im happy with that :)

admit it
you've been beaten

~shut

footballjds

2009-05-15 20:49:42

if u check the flash in 0 ms then you can't be comparing with a changing color eh?
you'd have to be checking with a static color. so IMO yours can't be completely accurate?

Shuttleu

2009-05-15 21:17:03

From: footballjds
if u check the flash in 0 ms then you can't be comparing with a changing color eh?
you'd have to be checking with a static color. so IMO yours can't be completely accurate?


but it is
i have tested it with it flashing
then i tested it without it flashing and it had no problems determining between the two

~shut

footballjds

2009-05-15 21:55:30

wait a month ;)

senrath

2009-05-15 22:12:38

From: footballjds
wait a month ;)


Before you knock his methods, you might wanna take a peek at GameTab.scar.

SRL already uses quite a few static color comparisons.

footballjds

2009-05-15 22:25:15

i know it does. when colors are static… :D

Nadeem

2009-05-15 22:49:27

Anyway :P Now imma have to reveal my secret weapon xD Gimme an hour or two, once I get home, pwnage will arrive! :D ~ BTW, my method still beats you when checking for all.



~NS

Shuttleu

2009-05-15 23:38:18

From: Nadeem
Anyway :P Now imma have to reveal my secret weapon xD Gimme an hour or two, once I get home, pwnage will arrive! :D ~ BTW, my method still beats you when checking for all.



~NS


thats because you dont check all the skills whereas i do

~shut

Mystic

2009-05-17 08:27:29

This Function Owns! I'm using it in my new scripts :)
Just waiting for the update <3.

Nadeem

2009-05-17 12:02:07

Released v3 of this function :D Now there is nothing there to complain about it :P As fast as Shuttleu's and does a few extra intelligent features ;)



~NS

Mystic

2009-05-17 12:59:17

W00t!! This function is soo awesome! Good job Nadeem! :)
Rep++

Floor66

2009-05-18 09:16:52

From: Nadeem
haha yes :) I was soo proud when you first released that :P Cuz it was an extension of my CheckMotion(); just alot more l77t :) And my AbstractMotion doesn't use get color, it is clearly based off bitmap finding through the use of a canvas :)



~NS


Yup. When I saw your funcs I was all like I CAN DO THAT BETTER :norris::norris::norris:.

Spoilersss…
Nah jk man. You gave the idea and I really needed it.

Nadeem

2009-05-18 09:30:10

Lol, And you did :P
Its probably cuz your from Netherlands :P You are automatically 1337!



~NS