PDA

View Full Version : [Update] SRL: Mar. 5th, 2012 ~ New Randoms Solvers



Coh3n
03-06-2012, 12:08 AM
New Randoms System
_____________________________


Introduction:


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 (http://villavu.com/forum/forumdisplay.php?f=460) section. For all commits, go here (https://github.com/SRL/SRL-5/commits/master). For the complete diff, go here (https://github.com/SRL/SRL-5/pull/22).


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:

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.



Conclusion:

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 (http://villavu.com/forum/forumdisplay.php?f=460) section.



Cheers,
The SRL Dev Team

Kyle Undefined
03-06-2012, 12:14 AM
Awesome! So glad you finally released it! :D Great work everyone! :)

Harry
03-06-2012, 12:15 AM
Yay, nice work.

Sin
03-06-2012, 12:23 AM
Glad you incorporated WaitDTM :)

xtrapsp
03-06-2012, 12:28 AM
Wait is this an update? :P I'm slightly confused between this thread and the beta thread

Ashaman88
03-06-2012, 12:31 AM
This is great, good job yall!

Harry
03-06-2012, 12:33 AM
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
03-06-2012, 02:24 AM
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
03-06-2012, 02:25 AM
Awesome, great work (:

Coh3n
03-06-2012, 02:30 AM
Flight: No, SRL_OnRandomCall is called every time FindNormalRandoms is called. SRL_OnFindRandom is called when one is detected.

Flight
03-06-2012, 02:39 AM
Flight: No, SRL_OnRandomCall is called every time FindNormalRandoms is called. SRL_OnFindRandom is called when one is detected.

Understood, thank you.

NCDS
03-06-2012, 02:47 AM
Excellent job <3

Geo
03-06-2012, 03:31 AM
ReturnTPAExceptColors added to color.simba.

I like this addition, :D

__

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

Bennigan
03-06-2012, 04:45 AM
Great work guys, thanks to everyone that contributed to the update,

Er1k
03-06-2012, 05:10 AM
Thank you devs! That's amazing. It's high time for me to bot the skills I want outside SW lobby :D

RyGuy
03-06-2012, 05:20 AM
WaitNone removed?

Psilocybin
03-06-2012, 05:51 AM
I can't get SRL to compile.....

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

Coh3n
03-06-2012, 06:13 AM
WaitNone removed?I don't think so? I can't remember.


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
03-06-2012, 06:17 AM
I don't think so? I can't remember.

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

Coh3n
03-06-2012, 06:31 AM
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
03-06-2012, 07:14 AM
[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
03-06-2012, 01:53 PM
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
03-06-2012, 04:07 PM
[Error] (737:6): Unknown identifier 'PercentBlackMM' at line 736
Is there new function to do this or do i have do my own?

SweDam
03-06-2012, 04:15 PM
How do i use it? :)

'Toxin
03-06-2012, 04:16 PM
How do i use it? :)

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

SweDam
03-06-2012, 04:26 PM
I can't find anything that helps me. :(

nokkasiili
03-06-2012, 04:27 PM
I can't find anything that helps me. :(

Just run srl update :bart:

SweDam
03-06-2012, 04:39 PM
I don't need to do anything at all? :) Just if I want to change something like disable a random or something? :)

nokkasiili
03-06-2012, 04:42 PM
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
03-06-2012, 06:23 PM
[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.


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.


[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
03-06-2012, 07:27 PM
Awesome, will try to implement with my scripts

Home
03-06-2012, 07:39 PM
Good job people!

~Home

J J
03-06-2012, 08:31 PM
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
03-14-2012, 04:03 PM
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
03-14-2012, 04:40 PM
Great work! Nice release and Thx 2 Demise for all your hard work on the Random Event's

Coh3n
03-14-2012, 11:26 PM
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
03-15-2012, 07:35 PM
Good job to everyone that made this happen :)

z92
03-22-2012, 02:26 PM
These randoms were solved successfully today:
Mime
Teleport-levers
Pillory Puzzle

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

Cwil
07-04-2012, 04:04 PM
Everytime i get a random event... it logs me out and never does it.

Ezio Auditore da Firenze
07-04-2012, 04:06 PM
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.