SRL Archive - SRL Suggestions

A small improvement to FindNormalRandoms.


Main

2009-09-13 00:37:26

Problem: FindNormalRandoms constantly check for music tab (90% of the time when the procedure is called), so this should help.

I've done a check on all randoms couple of days ago, and found that all random events (feel free to check this yourself) display a NPC message upon arrival. Which means if the character still have the normal chat, you are probably NOT in random.

So, go to your scripts, and add this to your random finding procedure.

Procedure xx
begin
//This color is the color of the bottom arrow of the scroll bar in chat, it goes away when a NPC chat pops up.
If (not(Getcolor(499, 455)= 4807525)) then FindNormalRandoms;

By adding this Getcolor procedure, your script will stop checking for randoms when you are (most likely) NOT in one, thus stopping your character from checking their music tab 10 times a minute ^^.


*NOTE*
If a random even pops up while your script is clicking some thing, its very possible that your script will remove the npc chat and not being able to detect the random event.
Solutions:

Case.

//Coh3n's Draynor Chop n Bank
Procedure CheckRandom;
Begin
LampSkill := 'attack';
Players[CurrentPlayer].Integers[15] := Players[CurrentPlayer].Integers[15] + 1;
case random (10) of
0: FindNormalRandoms;
1..9:
begin
If (not(Getcolor(499, 455)= 4807525))then FindNormalRandoms;
end;
Disguise('Checking Random');
End;
Or instead of finding the color of the npc chat, if you have a SYMBOL or a UNIQUE color on your minimap, you can use them to make sure if your player is in random or not.
For example:
Lets say you are wcing at draynor bank, there will always be 2 symbols present: Water or Bank, therefor you can add them to your checking random.

If (not(FindSymbol(rx, ry, 'Water')) or (not(FindSymbol(rx, ry, 'Bank')) or (not(Getcolor(499, 455)= 4807525)) then FindNormalRandoms;
Of course, you can use the case method ^^.

Rich

2009-09-13 00:53:59

Or just modify FindNormalRandoms:

function FindNormalRandoms: Boolean;
var
Int: Integer;
begin
if not(Getcolor(499, 455) = 4807525) then
begin
for Int := 1 to 8 do
begin
case Int of
1: Result := SolveTeleportRandoms;
2: Respond;
3: Result := FindDead;
4: Result := FindLamp(LampSkill);
5: Result := RC;
6: Result := FindMod;
7: if (SRL_Procs[srl_OnRandomCall] <> nil) then
SRL_Procs[srl_OnRandomCall]();
8: if High(Players[CurrentPlayer].BoxRewards) > -1 then
Result := UseRewardBox;
end;
if Result then
begin
if (SRL_Procs[srl_OnFindRandom] <> nil) then
SRL_Procs[srl_OnFindRandom]();
Break;
end;
end;
end;
end;

Main

2009-09-13 00:56:53

It might not always be the case, because the script can be clicking when teled to a npc (which gets rid of the npc chat).

caused

2009-09-13 00:56:59

quite effective, good job ! :)

Main

2009-09-13 01:54:48

If any one gets a random that doesn't pop up npc chat. Please tell me too!

Coh3n

2009-09-17 23:11:24

From: Main_Ftw
If any one gets a random that doesn't pop up npc chat. Please tell me too!

So far I've only gotten positive feedback when I added this to my scripts. Good job. Also, your signature is awesome! I lol'd. :p

Coh3n

EDIT: Although it does seem to work, it is really slow. For example, in my powerchopper, I have the script check for randoms after it drops each log. Using your method, it waits about a second before moving to the next log. If I replace what you have with just "FindNormalRandoms" it goes much, much faster.

Main

2009-09-18 00:08:28

Then let the script check random AFTER dropping ^^.

Coh3n

2009-09-18 00:09:39

From: Main_Ftw
Then let the script check random AFTER dropping ^^.


Yeah, but what if it drops the second log and then goes into a random? I may be wrong, but aren't there a couple randoms where you can't see your inventory? So it would try to drop logs that aren't there?

senrath

2009-09-18 00:50:26

From: Coh3n
Yeah, but what if it drops the second log and then goes into a random? I may be wrong, but aren't there a couple randoms where you can't see your inventory? So it would try to drop logs that aren't there?


Combine it with an ExistsItem check, then.

Coh3n

2009-09-18 00:57:43

From: senrath
Combine it with an ExistsItem check, then.

Oo yes, good idea. :)

Main

2009-09-18 01:39:10

You don't need, because DropItem, stop if it doesn't exist :D

Coh3n

2009-09-18 01:59:42

From: Main_Ftw
You don't need, because DropItem, stop if it doesn't exist :D


Oh, okay, thanks. :)

Main

2009-09-19 07:55:26

Updated the first post with addition information and fixese.

Smarter Child

2009-09-23 02:51:59

o.O N1ce, but i don't quite follow you with draynor bank thing. Wouldn't you need to check for randoms even if you aren't at Draynor bank?

Main

2009-09-23 02:58:07

?
Because the player will always be moving from bank to draynor, you don't need to findrandom if the symbol Fish or the symbol Bank is present.

Coh3n

2009-09-23 04:28:33

From: Smarter Child
o.O N1ce, but i don't quite follow you with draynor bank thing. Wouldn't you need to check for randoms even if you aren't at Draynor bank?


To add on to what Main said… There is always either the bank symbol or the fishing symbol visible in the minimap when you're chopping willows in Draynor. So basically, it tells the script to look for a random of neither symbol appears on the minimap.

It's actually quite a good idea in my opinion. :)

Camaro'

2009-11-02 07:00:14

I like everything about your idea, except the "Checking for symbols that you always see when your botting thing." I just dont like it, sorry for no explanation lol.

Nice ideas though ;)

Wanted

2009-11-03 10:48:44

What about randoms that don't involve being teleported or chat affected? There's a lot aren't there?

Like Dwarf, bees ect..

senrath

2009-11-03 10:55:10

From: IceFire908
What about randoms that don't involve being teleported or chat affected? There's a lot aren't there?

Like Dwarf, bees ect..


I'm pretty sure they were all removed.

Main

2009-11-03 17:18:46

Yeah, jagex removed alot of randoms.
All randoms teleport now.