Some more examples for SRL_Procs… (I use some of these personally).
OnRandomCall -> Refresh copied SMART client on the debug image window.
procedure PaintSmartClient;
begin
//Actual stuff here
end;
procedure SetupScript;
begin
SetupSRL;
SRL_Procs[srl_OnRandomCall] := @PaintSmartClient;
end;
OnNextPlayer -> SwitchWorlds
procedure SwitchWorlds;
begin
//blah blah
end;
procedure SetupScript;
begin
SetupSRL;
SRL_Procs[srl_OnNextPlayer] := @SwitchWorlds;
end;
Inbuilt antiban:
procedure MyAntiBanProc;
begin
// all your usual script based antiban here
end;
procedure SetupScript;
begin
SetupSRL;
SRL_Procs[srl_AntiBan] := @MyAntiBanProc;
end;
SRL_Procs[srl_AntiBan] is called when during FFlag and Flag whilst waiting for the character to reach the flag. You could also assign MyAntiBanProc to srl_OnRandomCall to make sure antiban is called at the same time as FindNormalRandoms.
Just a few examples but the point I'm trying to make is that the procedure doesn't have to be simple. Use your imagination and go beserk.
Also something that was not mentioned….
{*******************************************************************************
function GetChatBoxText(Line, TextCol: Integer): string;
By: ZephyrsFury
Description: Gets text on the line Line with colour TextCol. (Line 1 is the top,
Line 8 is the bottom line).
Colours:
clMessage/clBlack - Black text messages ("Oh Dear you are dead", etc).
clChat/clBlue - Chat messages from you and other players.
clTrade/clPurple - Colour of trade request text.
clFriend - Colour of friend and clan chat.
Works with other colours too.
*******************************************************************************}
{*******************************************************************************
function FindChatBoxText(Text: string; Line: Integer; TextCol: Integer): Boolean;
By: ZephyrsFury
Description: Searches for Text on Line with colour TextCol. True if found.
*******************************************************************************}
{*******************************************************************************
function IsChatBoxTextAnyLine(Text: string; TextCol: Integer): Boolean;
By: ZephyrsFury
Description: Returns true if Text with colour TextCol is found anywhere in the
chat box.
*******************************************************************************}
{*******************************************************************************
function ChatBoxTextArray(TextCol: Integer): TStringArray;
By: ZephyrsFury
Description: Gets and return a TStringArray with the contents of each line with
the colour TextCol (see GetChatBoxText for list of colours).
Line 1 is Result[1]
Line 2 is Result[2]
Line 3 is Result[3]
Line 4 is Result[4]
Line 5 is Result[5]
Line 6 is Result[6]
Line 7 is Result[7]
Line 8 is Result[8]
*******************************************************************************}
New Chat Box Text Functions in Text.scar.These new functions combine old Chatbox functions where there used to be separate functions for just black message and blue chat text. These new functions work with all chat text including message, chat, trade and private chat messages. The 4 functions above are similar to many of the old functions and do the same thing (apart from the colour) as to minimise the amount of editing a script requires to be ready for SRL #30.
Changes for commom old functions:
IsBlackText('Text', LineNo) -> FindChatBoxText(LineNo, 'Text', clMessage)
GetBlackText(LineNo) -> GetChatBoxText(LineNo, clMessage)
IsBlackTextAnyLine('Text') -> IsChatBoxTextAnyLine('Text', clMessage)
ChatsBlackText -> ChatBoxTextArray(clMessage)