SRL Archive - FAQ

Saving RS chatlogs


sadzx1

2011-12-17 04:41:06

I wanted to enable the function of auto saving rs chatlogs.
From the SRL chat file, theres a function
{*******************************************************************************
function SaveToChatLog: Boolean;
By: WT-Fakawi / masquerader
Description: Saves chat to log file
*******************************************************************************}
procedure SaveToChatLog;
begin
FixChat;
OldLine := TheLine;

if(LastChatter(TheName))then
begin
GetLastChatText(TheLine);
TheLine:=' '+TheLine+' ';
if OldLine <> TheLine then
try AddToSRLLog(TheName+':'+TheLine); except end;
end else
begin
TheLine:=TheName;
if OldLine <> TheLine then
try AddToSRLLog(TheLine); except end;
end;
end;

How do i enable this? copy it to simba? at the bottom of the script im using?
i have also searched forum and saw this
http://villavu.com/forum/showthread.php?t=58867&highlight=chatlog
once again, where do i copy those commands?
thx in advance

EDIT: when it does actually save, which folder will it saves the chatlog to?

DeSnob

2011-12-17 07:08:05

You just have to call this in the script.
SaveToChatLog;
It'll save to the Logs folder in SRL.

sadzx1

2011-12-17 08:55:47

From: DeSnob
You just have to call this in the script.
SaveToChatLog;
It'll save to the Logs folder in SRL.


what do u mean by "call this in the script"? add that to the top/btm of the script?

kanah

2011-12-17 09:06:22

he means something like this….

program new;
{$i SRL\SRL.SCAR}

//some code


begin
//SETUP code here
SaveToChatLog;

//Rest of your code
end.

Daniel

2011-12-17 09:15:40

This would be a situation where threading would be useful.

Unfortunately, the only way you can do it won't save every line of the chat (depends on the conversation [how many people talking, etc] and how often you call this method).

sadzx1

2011-12-18 08:21:34

From: kanah
he means something like this….

program new;
{$i SRL\SRL.SCAR}

//some code


begin
//SETUP code here
SaveToChatLog;

//Rest of your code
end.


Theres a lot of "begin" and "end" in the script, which 1 should i insert at?
what i did for the mining script was:

//some codes

procedure DeclareSettings();
begin (the first "begin" in the script)
MSI_Settings[SETUP_DEBUG_SMART] := True; // Debugs things onto SMART (may cause lag)
MSI_Settings[SETUP_SAVE_DEBUG] := True; // Save's the debug box text to a file
MSI_Settings[SETUP_SAVE_REPORT] := True; // Save's the progress report to a file
MSI_Settings[SETUP_HUMAN_BREAK] := True; // Take more human like breaks
MSI_Settings[SETUP_SWITCH_WORLDS] := True; // Switch worlds when switching players or after breaks
MSI_Settings[SETUP_PRINT_REPORT] := True; // Will only print the short report in the debug box (will still save long report to file)
MSI_Settings[SETUP_BREAK_TIME] := 15; // Single player only - how long to break for (in minutes)
MSI_Settings[SETUP_DEBUG_LEVEL] := 10; // The lower the number, the less the script will debug
MSI_Settings[SETUP_ANTIBAN_WAIT] := 30000; // Minimum time to wait between antibans (in milliseconds 1000ms = 1s)
MSI_Settings[SETUP_RANDOMS_WAIT] := 10000; // Minimum time to wait between randoms checks
MSI_Settings[SETUP_STATS_ID] := ''; // Stats ID
MSI_Settings[SETUP_STATS_PASS] := ''; // Stats password
MSI_Settings[SETUP_QC_LEVELUP] := True; // Quick chat when you level up, only available when your level is above 20
MSI_Settings[SETUP_MAX_PLAYERS] := 30; // How many players around you before switching worlds
MSI_Settings[SETUP_RANDOM_NP] := True; // Choose a random player when switching players?
SaveToChatLog;
end;
(*
DeclarePlayers
~~~~~~~~~~~~~~

.. code-block:: pascal

procedure DeclarePlayers();

When called, sets the global variable 'MSI_Players.' This is the procedure
the user needs to setup if they elect not to use the player form.

*)
procedure DeclarePlayers();
var
i: Integer;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
SetLength(MSI_Players, HowManyPlayers);

for i := 0 to High(MSI_Players) do
SetLength(MSI_Players.Scripts, 100);

CurrentPlayer := 0;
CurrentScript := 0;

with MSI_Players[0] do
begin
….(and more codes)


but it doesnt seem to work. Also it wont save every chat line?

nickrules

2011-12-18 08:27:28

From: sadzx1
Theres a lot of "begin" and "end" in the script, which 1 should i insert at?
what i did for the mining script was: <MSI>


but it doesnt seem to work. Also it wont save every chat line?


It would only save what it finds at that moment in time. I'd suggest putting it somewhere in the mainloop, but it may be hard to do find a good spot, since the script you're modifying is so complex. But the idea is that you want to call it often - because you haven't got anything setup to detect new lines and call it only then, you'll have to call it frequently instead of intelligently.

sadzx1

2011-12-18 10:12:37

From: nickrules
It would only save what it finds at that moment in time. I'd suggest putting it somewhere in the mainloop, but it may be hard to do find a good spot, since the script you're modifying is so complex. But the idea is that you want to call it often - because you haven't got anything setup to detect new lines and call it only then, you'll have to call it frequently instead of intelligently.


meaning that to ensure every line is detected, i had to add in the function in between the sea of codes many times?
like
(few line of codes)
SaveToChatLog;
(few line of codes)
SaveToChatLog;
(few line of codes)
SaveToChatLog;
…

will that consume alot memory/cause the script to pause too often/rendering it inefficient?
is there any intelligent way of doing it then?
i just want save chatlogs to check if i had been reported.

EDIT: im using MSI phoenix's powerminer btw

NCDS

2011-12-18 12:22:11

We could probably add the option to save chat logs in MSI if it'd be used.

Nava2

2011-12-18 12:30:26

You could do this:

procedure LogChatWrapper;
begin
SaveToChatLog;
end;

//.. in setup:
SRL_Procs[srl_onRandomCall] := @LogChatWrapper;

This will cause it to Log the chat window every time Find*Randoms is called. :)

For more information on the hooks for SRL's custom procedure calls:
https://github.com/SRL/SRL-5/blob/master/srl/core/globals.simba

sadzx1

2011-12-18 21:09:34

From: Nava2
You could do this:

procedure LogChatWrapper;
begin
SaveToChatLog;
end;

//.. in setup:
SRL_Procs[srl_onRandomCall] := @LogChatWrapper;


This will cause it to Log the chat window every time Find*Randoms is called. :)

For more information on the hooks for SRL's custom procedure calls:
https://github.com/SRL/SRL-5/blob/master/srl/core/globals.simba


ok will try this. but random is only called every 10+ sec or so, when im doing skilling the game message such as "u swing the pickaxe" "mine some ore" will cover up any chat pretty fast. unless i increase the frequencies (MSI_Settings[SETUP_RANDOMS_WAIT] := 10000; // Minimum time to wait between randoms checks)?


From: NCDS
We could probably add the option to save chat logs in MSI if it'd be used.


That would definitely be appreciated. we could pretty much tell if our acct has been flagged from the chatlogs as jagex relies heavily on player reports. so it will be exceptionally helpful to decide which acct to stop botting for awhile.
im wondering if keeping the game message to "All" is still required to run the scripts successfully? if it can be turned off then it will be very easy to catch any player chats as they will remain on the screen for a long time.

nickrules

2011-12-18 23:16:29

From: sadzx1
That would definitely be appreciated. we could pretty much tell if our acct has been flagged from the chatlogs as jagex relies heavily on player reports. so it will be exceptionally helpful to decide which acct to stop botting for awhile.
im wondering if keeping the game message to "All" is still required to run the scripts successfully? if it can be turned off then it will be very easy to catch any player chats as they will remain on the screen for a long time.


iirc MSI does not rely on the game chat at all.