SRL Archive - SRL Updates & Announcements

SRL: Mar. 5th, 2012 ~ New Randoms Solvers


Coh3n

2012-03-05 19:08:45

New Randoms System
_____________________________



Introduction:

[INDENT]This release comes with several new, useful, functions and more importantly, a brand new random event solver system. If you're interested on how some events were solved, take a look at the source code (I don't want to explain every single one). There is a short description of each solver at the top of each .simba file.

First and foremost, thanks very much for the people who supplied me with accounts in random events. You were a huge help. I would especially like to thank bolshak25 and kevin33 as they have provided me with several accounts time and time again. A huge thanks also goes to DemiseScythe who wrote most of the original solvers (I just cleaned them up) and worked alongside me though out the process. Without her, there's no way I would have taken on a project like this.

NOTE: For the status of each solver, please see it's thread in the SRL Randoms section. For all commits, go here. For the complete diff, go here.[/INDENT]


Notable Changes:

  • A global array, SRL_Randoms, is set in SetupSRL. You can disable any random solver (will logout when found) at any time, by doing this:

  • SRL_Randoms[SRL_RAND_FROG].disabled := true;
  • You can disable ALL randoms by setting a global variable:

  • SRL_DisableRandoms := true;
  • A global variable, SRL_RandomScreenShot, has been added for the option to save a screenshot in Simba/Includes/SRL/logs/ when a random event is detected. To do so, add this to your script:

  • SRL_RandomScreenShot := true;
  • The LampSkill global variable is no longer in use (but remains to avoid compiling errors). Instead, the lamp skill is set per player. It is also set to an integer (skill constant), rather than a string. Since all integers are set to 0 by default, the default skill is SKILL_ATTACK.

  • with players[0] do
    begin
    name := '';
    pass := '';
    active := true;
    boxRewards := ['amp'];
    lampSkill := SKILL_MINING;
    end;
  • When Simba 990+ is released, each random file can be tested individually without editing the file. This will require a few changes when Simba 990 is released.
  • FindDead, FindMod, and FindDwarvenPopup have been moved to antiban.simba (the Reincarnate variable works just as it did before this update). They are still handled in FindNormalRandoms just as before, although I'm not sure if they will be in the future. It would be safest as a scripter to set SRL_Procs[SRL_OnRandomCall]. Example,

  • procedure Coh3n_OnRandomCall();
    begin
    if (findDead()) then
    deathWalk();

    if (findMod()) then
    changeWorlds();

    findDwarvenPopup();
    end;

    begin
    setupSRL();
    SRL_Procs[SRL_OnRandomCall] := @Coh3n_OnRandomCall;
    end.
    SRL_Procs[OnRandomCall] is called every time FindNormalRandoms or FindNonInventoryRandoms is called.
  • All solvers save the debug to SRL log files. The files are named by date and time, and are saved in Simba/Includes/SRL/logs/. You can disable logging at any time by setting SRL_DisableLogging in your script (I discourage this as it doesn't help us developers :p). You can also change the file save path by setting SRL_SavePath:

  • SRL_SavePath('c:/Users/Coh3n/Desktop/');
    SRL_DisableRandoms := true;
  • Not a change, but worth noting: SRL_Procs[SRL_OnFindRandom], if set, will be called when a random event is detected. It will then continue to solve the random.
  • SRL_OnFindRandomCall is no longer used as it was pointless.

Function Additions:
  • GetMusic, AreTalking, GetNPCChatName, and DoConversation added to gametab.simba.
  • TakeScreen added to SRLlog.simba.
  • Grid added to math.simba (incredible function for things like invBox, gameTab, bankBox, etc.).
  • GridBox added to math.simba.
  • WaitFindDTM, WaitTabExists, and WaitNPCTalking added to timing.simba.
  • ReturnTPAExceptColors added to color.simba.

SRL Random Tool:
[INDENT]This is a neat tool that I discovered shortly before starting this thread. The random tool is a form that is run when a random event is detected. It then gives the user the choice whether they want to solve the random themselves, or have SRL do it. Unfortunately, this tool doesn't work properly, but it is quite simple and wouldn't require a lot of editing for it to work again.

If someone would like to fix it up, the file is in Includes/SRL/srl/misc/randomtool.simba. I really don't think it needs that much editing to work properly, but some of the code is messy and may be hard to understand.
[/INDENT]


Conclusion:
[INDENT]Please post any issues (along with debug text, if possible) on the proper thread for that random event. All threads can be found in the SRL Randoms section.
[/INDENT]


Cheers,
The SRL Dev Team

Kyle Undefined

2012-03-05 19:14:29

Awesome! So glad you finally released it! :D Great work everyone! :)

Harry

2012-03-05 19:15:16

Yay, nice work.

Sin

2012-03-05 19:23:00

Glad you incorporated WaitDTM :)

xtrapsp

2012-03-05 19:28:51

Wait is this an update? :P I'm slightly confused between this thread and the beta thread

Ashaman88

2012-03-05 19:31:47

This is great, good job yall!

Harry

2012-03-05 19:33:17

From: xtrapsp
Wait is this an update? :P I'm slightly confused between this thread and the beta thread

It's into mainline SRL now, so yeah.

Flight

2012-03-05 21:24:01

Looks great, I just have one small question I might have over-looked. When searching for randoms via 'FindNormalRandoms' we can still use "SRL_Procs[SRL_OnRandomCall]" to activate a procedure/function right? We just declare it at the beginning of a script? And 'SRL_OnRandomCall' only activates when a random event is found? For example:


procedure FoundARandom;
begin
Writeln('Found a random!');
Inc(RandomsCount);
PlaySound(ScriptPath+'Alert.wav');
end;

begin
setupSRL();
SRL_Procs[SRL_OnRandomCall] := @FoundARandom;

repeat
FindNormalRandoms;
until(False)
end.

sahibjs

2012-03-05 21:25:02

Awesome, great work (:

Coh3n

2012-03-05 21:30:17

Flight: No, SRL_OnRandomCall is called every time FindNormalRandoms is called. SRL_OnFindRandom is called when one is detected.

Flight

2012-03-05 21:39:12

From: Coh3n
Flight: No, SRL_OnRandomCall is called every time FindNormalRandoms is called. SRL_OnFindRandom is called when one is detected.


Understood, thank you.

NCDS

2012-03-05 21:47:56

Excellent job <3

Geo

2012-03-05 22:31:11

From: Coh3n
ReturnTPAExceptColors added to color.simba.


I like this addition, :D

__

Good job & thank you to everyone that contributed to this update. :)

Bennigan

2012-03-05 23:45:22

Great work guys, thanks to everyone that contributed to the update,

Er1k

2012-03-06 00:10:32

Thank you devs! That's amazing. It's high time for me to bot the skills I want outside SW lobby :D

RyGuy

2012-03-06 00:20:31

WaitNone removed?

Psilocybin

2012-03-06 00:51:16

I can't get SRL to compile…..

i get bunch of missing variable errors
TeleRandoms, r_userandomtool etc.

Coh3n

2012-03-06 01:13:02

From: RyGuy
WaitNone removed?
I don't think so? I can't remember.

From: Psilocybin
I can't get SRL to compile…..

i get bunch of missing variable errors
TeleRandoms, r_userandomtool etc.
What script are you using? The random tool was removed as it doesn't work properly in Simba. It'll be fixed as soon as possible.

RyGuy

2012-03-06 01:17:36

From: Coh3n
I don't think so? I can't remember.


[Error] (115:28): Unknown identifier 'WaitNone' at line 114

Coh3n

2012-03-06 01:31:02

Oh, that function didn't do anything. It was literally this:

procedure WaitNone();
begin
end;
If you just remove that line in whatever script you're using, it won't change anything.

xtrapsp

2012-03-06 02:14:09

[Hint] C:\Simba\Includes\SRL/SRL/core/antirandoms\beekeeper.simba(194:3): Variable 'T' never used at line 193
[Error] C:\Simba\Includes\SRL/SRL/skill/woodcutting.simba(116:13): Unknown identifier 'Screenshots' at line 115
Compiling failed.

It opened up woodcutting.simba and displayed this?

Don't want to randomly make Screenshots: Integer; to remove it…

Psilocybin

2012-03-06 08:53:18

From: Coh3n
What script are you using? The random tool was removed as it doesn't work properly in Simba. It'll be fixed as soon as possible.

my private, it worked before i updated SRL.

why include it in SRL if its not being used????

nokkasiili

2012-03-06 11:07:23

[Error] (737:6): Unknown identifier 'PercentBlackMM' at line 736
Is there new function to do this or do i have do my own?

SweDam

2012-03-06 11:15:21

How do i use it? :)

'Toxin

2012-03-06 11:16:11

From: SweDam
How do i use it? :)


Read the first post, ALL information about how to use the new system is there.

SweDam

2012-03-06 11:26:33

I can't find anything that helps me. :(

nokkasiili

2012-03-06 11:27:59

From: SweDam
I can't find anything that helps me. :(


Just run srl update :bart:

SweDam

2012-03-06 11:39:31

I don't need to do anything at all? :) Just if I want to change something like disable a random or something? :)

nokkasiili

2012-03-06 11:42:44

From: SweDam
I don't need to do anything at all? :) Just if I want to change something like disable a random or something? :)


You got it.

Coh3n

2012-03-06 13:23:10

From: xtrapsp
[Hint] C:\Simba\Includes\SRL/SRL/core/antirandoms\beekeeper.simba(194:3): Variable 'T' never used at line 193
[Error] C:\Simba\Includes\SRL/SRL/skill/woodcutting.simba(116:13): Unknown identifier 'Screenshots' at line 115
Compiling failed.

It opened up woodcutting.simba and displayed this?

Don't want to randomly make Screenshots: Integer; to remove it…
I'll fix it in the next version.

From: Psilocybin
my private, it worked before i updated SRL.

why include it in SRL if its not being used????
It will be used as soon as it's fixed. I'll try to do it as soon as possible.

From: nokkasiili
[Error] (737:6): Unknown identifier 'PercentBlackMM' at line 736
Is there new function to do this or do i have do my own?
That may have been in the old common.simba. I thought I moved it to mapwalk.simba, but maybe not. I'll fix that for the next version as well. E: Oh, there's PercentColorMM(color, tol: integer); so just use it like this:

percentColorMM(clBlack, 0);

begginer

2012-03-06 14:27:05

Awesome, will try to implement with my scripts

Home

2012-03-06 14:39:17

Good job people!

~Home

J J

2012-03-06 15:31:28

Amazing work, thanks a lot. I've been waiting for this before adding anti-randoms to my scripts, will work on adding it now!

Brandon

2012-03-14 12:03:19

Infinite loop in FindNormalRandoms.. Didn't know where to report this but in my script, was getting around to fixing some scripts and when I call FindNormalRandoms even once, it starts to spam the console about:

"Characters Split too wide.. Try Decreasing MinSpacing" and stays there for a good 10-15 seconds :S
Commented out FindNormalRandoms and everything works like a charm.. Not sure what's causing it as I didn't take a look but just reporting it for anyone else having this problem.

Uncommented.. and it spammed me again.. repeated to make sure. and Yes it definitely was FindNormalRandoms.

Sir Ducksworthy

2012-03-14 12:40:01

Great work! Nice release and Thx 2 Demise for all your hard work on the Random Event's

Coh3n

2012-03-14 19:26:15

From: ggzz
Infinite loop in FindNormalRandoms.. Didn't know where to report this but in my script, was getting around to fixing some scripts and when I call FindNormalRandoms even once, it starts to spam the console about:

"Characters Split too wide.. Try Decreasing MinSpacing" and stays there for a good 10-15 seconds :S
Commented out FindNormalRandoms and everything works like a charm.. Not sure what's causing it as I didn't take a look but just reporting it for anyone else having this problem.

Uncommented.. and it spammed me again.. repeated to make sure. and Yes it definitely was FindNormalRandoms.
Saying that for 10-15 isn't an infinite loop.

Do you know if SRL_Procs[SRL_OnRandomCall] or the like is set? This is the first I've heard of this and the update has been out for a while. It also works fine for me.

Olly

2012-03-15 15:35:51

Good job to everyone that made this happen :)

z92

2012-03-22 10:26:19

These randoms were solved successfully today:
Mime
Teleport-levers
Pillory Puzzle

Three in a row - that's simply awesome. Thank you developers :)

Cwil

2012-07-04 12:04:53

Everytime i get a random event… it logs me out and never does it.

Ezio Auditore da Firenze

2012-07-04 12:06:43

From: Cwil
Everytime i get a random event… it logs me out and never does it.


That depends on the script your using, and if the creator has implemented it to dealing with randoms, which in your case I don't think randoms are supported.