SRL Archive - Research & Development Lounge

[MK] AutoResponder [BETA]


MasterKill

2009-11-20 13:06:16

Hmm, I found this script between some old files (the never judged auto responder script).

I tested it and it seems like it still works.

Just paste it all over your CAutoRespond.scar (includes/srl/srl/core), and the setup will automatically run with srl and the responding with the "FindNormalRandoms".

If you have any feedback on it, please post it here ;)

If I get a lot of positive feedback I'll make an official release.

Version 2:

Type
TRespond = Record
Q, A: Array Of String;
End;

Function InputQA(AorQ: String): String; Forward;

Var
Responder: Array of TRespond;
MK_frmDesign, InvoerForm: TForm;
ResponderActive, QAdded, AAdded: Boolean;
List: Array [0..2] Of TListBox;
But: Array [0..10] Of TButton;
Txt: Array [0..4] Of TLabel;
Shape: Array [0..2] Of TShape;
QAlabel: TLabel;
InsertL: TRichEdit;
InsertTimer: TTimer;
InsertBox: TComboBox;
FormSave: TSaveDialog;
FormOpen: TOpenDialog;
OK: TButton;
HowManyResponds, LastTIMEresponded, RespondsMade, CurrentForm: Integer;
LastRespond, QorA, QAOutput: String;
UseAutoResponder: boolean;

Procedure MK_TimerLoop(Sender: TObject);
Var
MK, A: Integer;
Bold: Array Of String;
Begin
Case QorA Of
'Q': Bold := ['$nick'];
'A': Bold := ['$attack', '$strength', '$defence', '$range', '$prayer',
'$magic', '$runecrafting', '$hitpoints', '$agility', '$herblore',
'$thieving', '$crafting', '$fletching', '$slayer', '$mining',
'$smithing', '$fishing', '$cooking', '$firemaking', '$woodcutting',
'$farming', '$chatter'];
End;
If (Pos(#13, InsertL.Text) <> 0) Then
Begin
InsertL.Text := Replace(InsertL.Text, #13, '');
InsertL.Text := Replace(InsertL.Text, #10, '');
QAOutput := InsertL.Text;
invoerform.ModalResult:= mrOk;
End;
InsertL.SelStart := 0;
InsertL.SelLength := Length(InsertL.Text);
InsertL.SelAttributes.Style := [];
InsertL.SelAttributes.Color := clBlack;
InsertL.SelStart := Length(InsertL.Text);
For MK := 0 To GetArrayLength(Bold) - 1 Do
Begin
A := Pos(Bold[MK], InsertL.Text);
If (A > 0) Then
Begin
InsertL.SelStart := A - 1;
InsertL.SelLength := Length(Bold[MK]);
InsertL.SelAttributes.Style := [fsBold];
InsertL.SelAttributes.Color := clRed;
InsertL.SelStart := Length(InsertL.Text);
End;
End;
End;

Procedure MK_LoadSet(ArrayNumber: Integer; new: Boolean);
Var
MK, Hold, Holder: Integer;
Begin
For MK := 1 To 2 Do
List[MK].Clear;
If New Then
Begin
QAdded := False;
AAdded := False;
SetArrayLength(Responder[ArrayNumber].Q, 0);
SetArrayLength(Responder[ArrayNumber].A, 0);
End;
If (GetArrayLength(Responder[ArrayNumber].Q) = 0) Then
But[5].Enabled := False
Else
Begin
For MK := 0 To GetArrayLength(Responder[ArrayNumber].Q) - 1 Do
List[1].Items.Add(Responder[ArrayNumber].Q[MK]);
But[5].Enabled := True;
End;
If (GetArrayLength(Responder[ArrayNumber].A) = 0) Then
But[7].Enabled := False
Else
Begin
For MK := 0 To GetArrayLength(Responder[ArrayNumber].A) - 1 Do
List[2].Items.Add(Responder[ArrayNumber].A[MK]);
But[7].Enabled := True;
End;
List[0].Clear;
For MK := 0 To High(Responder) Do
Begin
If (GetArrayLength(Responder[MK].Q) = 0)
Or (GetArrayLength(Responder[MK].A) = 0) Then
List[0].Items.Add('[Error] not done')
Else
List[0].Items.Add(Responder[MK].Q[0]);
End;
List[0].ItemIndex := ArrayNumber;
If (GetArrayLength(Responder) = 1) Then
But[1].Enabled := False
Else
But[1].Enabled := True;
If Not (GetArrayLength(Responder) = 0) Then
Begin
But[4].Enabled := True;
But[6].Enabled := True;
But[2].Enabled := True;
But[10].Enabled := True;
For MK := 0 To HowManyResponds - 1 Do
If (GetArrayLength(Responder[MK].Q) > 0)
And (GetArrayLength(Responder[MK].A) > 0) Then
Hold := Hold + 1;
But[8].Caption := 'START with ' + IntToStr(Hold) + ' respond(s)';
If (Hold > 0) Then
But[8].Enabled := True
Else
But[8].Enabled := False;
End Else
But[10].Enabled := False;
End;

Procedure MK_ButtonClick(Sender: TObject);
Var
MK, MK2, Holder, Holder2: Integer;
SubString: String;
SaveF, LoadF: TStringList;
TempResp: Array of TRespond;
Begin
Case Sender Of
OK: Begin
QAOutput := InsertL.Text;
invoerform.ModalResult:= mrOk;
End;
InsertBox: Begin
Case QorA Of
'Q': Begin
Case InsertBox.ItemIndex Of
0: InsertL.Text := InsertL.Text + '$nick';
End;
End;
'A': Begin
Case InsertBox.ItemIndex Of
0: InsertL.Text := InsertL.Text + '$attack';
1: InsertL.Text := InsertL.Text + '$strength';
2: InsertL.Text := InsertL.Text + '$defence';
3: InsertL.Text := InsertL.Text + '$range';
4: InsertL.Text := InsertL.Text + '$prayer';
5: InsertL.Text := InsertL.Text + '$magic';
6: InsertL.Text := InsertL.Text + '$runecrafting';
7: InsertL.Text := InsertL.Text + '$hitpoints';
8: InsertL.Text := InsertL.Text + '$agility';
9: InsertL.Text := InsertL.Text + '$herblore';
10: InsertL.Text := InsertL.Text + '$thieving';
11: InsertL.Text := InsertL.Text + '$crafting';
12: InsertL.Text := InsertL.Text + '$fletching';
13: InsertL.Text := InsertL.Text + '$slayer';
14: InsertL.Text := InsertL.Text + '$mining';
15: InsertL.Text := InsertL.Text + '$smithing';
16: InsertL.Text := InsertL.Text + '$fishing';
17: InsertL.Text := InsertL.Text + '$cooking';
18: InsertL.Text := InsertL.Text + '$firemaking';
19: InsertL.Text := InsertL.Text + '$woodcutting';
20: InsertL.Text := InsertL.Text + '$farming';
21: InsertL.Text := InsertL.Text + '$chatter';
End;
End;
End;
InsertBox.Text := 'Add replacement';
End;
But[0]: Begin
HowManyResponds := HowManyResponds + 1;
SetArrayLength(Responder, HowManyResponds);
MK_LoadSet(HowManyResponds - 1, True);
List[0].ItemIndex := HowManyResponds - 1;
End;
But[1]: Begin
If (List[0].ItemIndex = -1) Then
Begin
ShowMessage('Please select the respond you want to delete.');
End Else
Begin
Holder := List[0].ItemIndex;
If (Holder + 1 = HowManyResponds) Then
Holder := Holder - 1
Else
If (Holder + 2 = HowManyResponds) Then
Responder[Holder] := Responder[Holder + 1]
Else
For MK := Holder To HowManyResponds - 2 Do
Responder[MK] := Responder[MK + 1];
HowManyResponds := HowManyResponds - 1;
SetArrayLength(Responder, HowManyResponds);
MK_LoadSet(Holder, False);
End;
End;
But[2]: Begin
FormSave.Filter := '.respond';
FormSave.ExeCute;
SaveF := TStringList.Create;
SaveF.Add('**SRL_AUTORESPOND_FILE**DO_NOT_EDIT**');
SaveF.Add(IntToStr(HowManyResponds));
For MK := 0 To HowManyResponds - 1 Do
Begin
SaveF.Add(IntToStr(GetArrayLength(Responder[MK].Q)));
If (GetArrayLength(Responder[MK].Q) > 0) Then
For MK2 := 0 To GetArrayLength(Responder[MK].Q) - 1 Do
SaveF.Add(Responder[MK].Q[MK2]);
SaveF.Add(IntToStr(GetArrayLength(Responder[MK].A)));
If (GetArrayLength(Responder[MK].A) > 0) Then
For MK2 := 0 To GetArrayLength(Responder[MK].A) - 1 Do
SaveF.Add(Responder[MK].A[MK2]);
End;
SaveToFile(SaveF, FormSave.FileName);
End;
But[3]: Begin
FormOpen.Filter := '.respond';
FormOpen.ExeCute;
LoadF := TStringList.Create;
If (FormOpen.FileName = '') Then Exit;
Try
If LoadFromFile(LoadF, FormOpen.FileName) then
Begin
If Not (LoadF.Strings[0] = '**SRL_AUTORESPOND_FILE**DO_NOT_EDIT**')
Then Begin
ShowMessage('The respond file has been editted or damaged. Co' +
'uldn''t load.');
Exit;
End;
HowManyResponds := StrToInt(LoadF.Strings[1]);
Holder := 2;
SetArrayLength(Responder, HowManyResponds);
For MK := 0 To HowManyResponds - 1 Do
Begin
SetArrayLength(Responder[MK].Q, StrToInt(LoadF.Strings[Holder]));
If Not (GetArrayLength(Responder[MK].Q) = 0) Then
For MK2 := 0 To GetArrayLength(Responder[MK].Q) - 1 Do
Responder[MK].Q[MK2] := LoadF.Strings[Holder + MK2 + 1];
Holder := Holder + GetArrayLength(Responder[MK].Q) + 1;
SetArrayLength(Responder[MK].A, StrToInt(LoadF.Strings[Holder]));
If Not (GetArrayLength(Responder[MK].A) = 0) Then
For MK2 := 0 To GetArrayLength(Responder[MK].A) - 1 Do
Responder[MK].A[MK2] := LoadF.Strings[Holder + MK2 + 1];
Holder := Holder + GetArrayLength(Responder[MK].A) + 1;
End;
End Else
Begin
ShowMessage('Couldn''t find the file, you might have moved or ' +
'deleted it.');
Exit;
End;
Except
ShowMessage('Load failed, the file might be dammaged.');
Finally
MK_LoadSet(0, False);
End;
End;
But[4]: Begin
SubString := InputQA('Q');
If (SubString = '') Then
Begin
ShowMessage('No question was found!');
Exit;
End;
Holder := GetArrayLength(Responder[List[0].ItemIndex].Q);
SetArrayLength(Responder[List[0].ItemIndex].Q, Holder + 1);
Responder[List[0].ItemIndex].Q[Holder] := SubString;
MK_LoadSet(List[0].ItemIndex, False);
List[1].ItemIndex := Holder;
End;
But[5]: Begin
If (List[1].ItemIndex = -1) Then
Begin
ShowMessage('Please select the responding question you want to ' +
'delete.');
End Else
Begin
Holder := List[1].ItemIndex;
Holder2 := GetArrayLength(Responder[List[0].ItemIndex].Q);
If (Holder + 1 = Holder2) Then
Holder := Holder - 1
Else
If (Holder + 2 = Holder2) Then
Responder[List[0].ItemIndex].Q[Holder] := Responder[List[0].ItemIndex].Q[Holder + 1]
Else
For MK := Holder To Holder2 - 2 Do
Responder[List[0].ItemIndex].Q[MK] := Responder[List[0].ItemIndex].Q[MK + 1];
SetArrayLength(Responder[List[0].ItemIndex].Q, Holder2 - 1);
MK_LoadSet(List[0].ItemIndex, False);
End;
End;
But[6]: Begin
SubString := InputQA('A');
If (SubString = '') Then
Begin
ShowMessage('No awnser was found!');
Exit;
End;
Holder := GetArrayLength(Responder[List[0].ItemIndex].A);
SetArrayLength(Responder[List[0].ItemIndex].A, Holder + 1);
Responder[List[0].ItemIndex].A[Holder] := SubString;
MK_LoadSet(List[0].ItemIndex, False);
List[2].ItemIndex := Holder;
End;
But[7]: Begin
If (List[2].ItemIndex = -1) Then
Begin
ShowMessage('Please select the responding awnser you want to delete.');
End Else
Begin
Holder := List[2].ItemIndex;
Holder2 := GetArrayLength(Responder[List[0].ItemIndex].A);
If (Holder + 1 = Holder2) Then
Holder := Holder - 1
Else
If (Holder + 2 = Holder2) Then
Responder[List[0].ItemIndex].A[Holder] := Responder[List[0].ItemIndex].A[Holder + 1]
Else
For MK := Holder To Holder2 - 2 Do
Responder[List[0].ItemIndex].A[MK] := Responder[List[0].ItemIndex].A[MK + 1];
SetArrayLength(Responder[List[0].ItemIndex].A, Holder2 - 1);
MK_LoadSet(List[0].ItemIndex, False);
End;
End;
But[8]: Begin
MK_LoadSet(List[0].ItemIndex, False);
For MK := 0 To GetArrayLength(Responder) - 1 Do
Begin
If (GetArrayLength(Responder[MK].Q) = 0)
Or (GetArrayLength(Responder[MK].A) = 0) Then
Begin
ShowMessage('Please delete the "not done" responds first.');
Exit;
End;
End;
ResponderActive := True;
MK_frmDesign.ModalResult:= mrOk;
End;
But[9]: MK_frmDesign.ModalResult:= mrOk;
But[10]: Begin
SetArrayLength(Responder, 0);
HowManyResponds := 0;
For MK := 0 To 2 Do
List[MK].Clear;
For MK := 4 To 7 Do
But[MK].Enabled := False;
For MK := 1 To 2 Do
But[MK].Enabled := False;
But[8].Enabled := False;
But[10].Enabled := False;
ShowMessage('All clear!');
End;
List[0]: Begin
If Not (List[0].ItemIndex = -1) Then
MK_LoadSet(List[0].ItemIndex, False);
End;
End;
End;

procedure MK_InitForm;
Var
MK: Integer;
begin
Case CurrentForm Of
0: Begin
MK_frmDesign := CreateForm;
MK_frmDesign.Left := 100;
MK_frmDesign.Top := 100;
MK_frmDesign.Width := 710;
MK_frmDesign.Height := 530;
MK_frmDesign.Caption := 'SARS - SRL''s Auto Responder Source - by MasterKill';
MK_frmDesign.Color := clwhite;
MK_frmDesign.Font.Color := clWindowText;
MK_frmDesign.Font.Height := -11;
MK_frmDesign.Font.Style := [];
MK_frmDesign.Visible := False;
MK_frmDesign.PixelsPerInch := 96;
For MK := 0 To 2 Do
Begin
Shape[MK] := TShape.Create(MK_frmDesign);
Shape[MK].Parent := MK_frmDesign;
Shape[MK].Brush.Color := 11842740;
Shape[MK].Pen.Color := 11842740;
End;
Shape[0].Left := 10;
Shape[0].Top := 70;
Shape[0].Height := 350;
Shape[0].Width := 230;
Shape[1].Top := 70;
Shape[1].Left := 250;
Shape[1].Width := 430;
Shape[1].Height := 350;
Shape[2].Left := 10;
Shape[2].Top := 430;
Shape[2].Height := 50;
Shape[2].Left := 10;
Shape[2].Width := 670;
For MK := 0 To 2 Do
Begin
List[MK] := TListBox.Create(MK_frmDesign);
List[MK].Parent := MK_frmDesign;
End;
List[0].Left := 20;
List[0].Top := 80;
List[0].Height := 330;
List[0].Width := 100;
List[0].OnClick := @MK_ButtonClick;
For MK := 1 To 2 Do
Begin
List[MK].Left := 260;
List[MK].Top := 80 + 180 * (MK - 1);
List[MK].Width := 300;
List[MK].Height := 150;
End;
For MK := 0 To 4 Do
Begin
Txt[MK] := TLabel.Create(MK_frmDesign);
Txt[MK].Parent := MK_frmDesign;
Txt[MK].Font.Name := 'Constantia';
End;
Txt[0].Top := 5;
Txt[0].Left := 160;
Txt[0].Caption := 'SRL''s auto responder';
Txt[0].Font.Size := 30;
Txt[1].Top := 45;
Txt[1].Left := 410;
Txt[1].Caption := 'by MasterKill';
For MK := 0 To 10 Do
Begin
But[MK] := TButton.Create(MK_frmDesign);
But[MK].Parent := MK_frmDesign;
But[MK].OnClick := @MK_ButtonClick;
But[MK].Width := 100;
But[MK].Height := 30;
End;
For MK := 0 To 3 Do
Begin
But[MK].Top := 170 + 40 * MK;
But[MK].Left := 130;
End;
For MK := 4 To 7 Do
Begin
Case MK Of
4, 5: But[MK].Top := 120 + 40 * (MK - 4);
6, 7: But[MK].Top := 300 + 40 * (MK - 6);
End;
But[MK].Left := 570;
End;
For MK := 8 To 10 Do
Begin
But[MK].Width := 200;
But[MK].Left := 20 + 225 * (MK - 8);
But[MK].Top := 440;
End;
But[0].Caption := 'Add respond';
But[1].Caption := 'Delete selected';
But[2].Caption := 'Save this list';
But[3].Caption := 'Load respond list';
But[4].Caption := 'Add question [Q]';
But[5].Caption := 'Delete selected Q';
But[6].Caption := 'Add awnser [A]';
But[7].Caption := 'Delete selected A';
But[8].Caption := 'START, use responder';
But[9].Caption := 'START, don''t use responder';
But[10].Caption := 'Clear all fields';
For MK := 4 To 7 Do
But[MK].Enabled := False;
For MK := 1 To 2 Do
But[MK].Enabled := False;
SetArrayLength(Responder, 0);
But[8].Enabled := False;
But[10].Enabled := False;
FormSave := TSaveDialog.Create(MK_frmDesign);
FormOpen := TOpenDialog.Create(MK_frmDesign);
End;
1: Begin
InvoerForm := CreateForm;
InvoerForm.Left := 259;
InvoerForm.Top := 132;
InvoerForm.Width := 495;
InvoerForm.Height := 110;
InvoerForm.Color := clBtnFace;
InvoerForm.Font.Color := clWindowText;
InvoerForm.Font.Height := -11;
InvoerForm.Font.Name := 'MS Sans Serif';
InvoerForm.Font.Style := [];
InvoerForm.Visible := False;
InvoerForm.PixelsPerInch := 96;
OK := TButton.Create(InvoerForm);
OK.OnClick:= @MK_ButtonClick;
OK.Parent := InvoerForm;
OK.Left := 420;
OK.Top := 40;
OK.Width := 50;
OK.Height := 20;
OK.Caption := 'OK';
QALabel := TLabel.Create(InvoerForm);
QALabel.Parent := InvoerForm;
QALabel.Left := 10;
QALabel.Top := 12;
InsertBox := TComboBox.Create(InvoerForm);
InsertBox.Parent := InvoerForm;
InsertBox.Top := 10;
InsertBox.Left := 170;
InsertBox.Width := 300;
InsertBox.OnClick := @MK_ButtonClick;
InsertBox.Font.Name := 'Courier';
InsertBox.Text := 'Add replacement';
InsertL := TRichEdit.Create(InvoerForm);
InsertL.Parent := InvoerForm;
InsertL.Left := 10;
InsertL.Width := 400;
InsertL.Top := 40;
InsertL.Height := 20;
InsertTimer := TTimer.Create(InvoerForm);
InsertTimer.Interval := 1000;
InsertTimer.Enabled := True;
InsertTimer.OnTimer := @MK_TimerLoop;
Case QorA Of
'Q': Begin
InsertBox.Items.Add('$nick your players nickname');
InvoerForm.Caption := 'Add an question';
QALabel.Caption := 'Add an [Q]uestion';
End;
'A': Begin
InsertBox.Items.Add('$attack your attack level');
InsertBox.Items.Add('$strength your strength level');
InsertBox.Items.Add('$defence your defence level');
InsertBox.Items.Add('$range your range level');
InsertBox.Items.Add('$prayer your prayer level');
InsertBox.Items.Add('$magic your magic level');
InsertBox.Items.Add('$runecrafting your RC level');
InsertBox.Items.Add('$hitpoints your HP level');
InsertBox.Items.Add('$agility your agility level');
InsertBox.Items.Add('$herblore your herblore level');
InsertBox.Items.Add('$thieving your thieving level');
InsertBox.Items.Add('$crafting your crafting level');
InsertBox.Items.Add('$fletching your fletching level');
InsertBox.Items.Add('$slayer your slayer level');
InsertBox.Items.Add('$mining your mining level');
InsertBox.Items.Add('$smithing your smitting level');
InsertBox.Items.Add('$fishing your fishing level');
InsertBox.Items.Add('$cooking your cooking level');
InsertBox.Items.Add('$firemaking your FM level');
InsertBox.Items.Add('$woodcutting your WC level');
InsertBox.Items.Add('$farming your farming level');
InsertBox.Items.Add('$chatter The player questioning');
InvoerForm.Caption := 'Add an awnser';
QALabel.Caption := 'Add an [A]wnser';
End;
End;
End;
End;
end;

procedure SafeMK_InitForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('MK_InitForm', v);
end;

procedure MK_ShowFormModal;
begin
Case CurrentForm Of
0: MK_frmDesign.ShowModal;
1: InvoerForm.ShowModal;
End;
end;

procedure MK_MK_ShowFormModal;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('MK_ShowFormModal', v);
end;

Procedure ShowForm(WhatForm: Integer);
Begin
CurrentForm := WhatForm;
SafeMK_InitForm;
MK_MK_ShowFormModal;
End;

Function InputQA(AorQ: String): String;
Begin
QorA := AorQ;
ShowForm(1);
Result := QAOutput;
End;

Procedure SetupSRLAutoResponder;
Begin
Try
//GetSelf.Hide;
ShowForm(0);
Except
ResponderActive := False;
srl_Warn('Setup_Responds_Form', 'Form did not work correctly.',
warn_AllVersions);
//GetSelf.Show;
Finally
WriteLn('STARTING, using auto responder: ' + BoolToStr(ResponderActive) +
'.');
//GetSelf.Show;
End;
End;

Function AutoRespond(LastLines: Integer): Boolean;
Var
MK, I, x, y, QIndex, TsysTime: Integer;
ChatText, ChatName, FinalRespond: String;
TempRespond: Array Of TRespond;
Skill: Array Of String;
P: TPoint;
Begin
If Not ResponderActive Then Exit;
If (LastLines < 1) Or (LastLines > 8) Then
Begin
srl_Warn('Fuction_AutoRespond()', 'Wrong "LastLines" amoult has been ' +
'enterd!', warn_AllVersions);
Exit;
End;
TsysTime := GetSystemTime;
For MK := 8 DownTo 9 - LastLines Do
Begin
P := TextCoords(MK);
If findcolor(x, y, clBlue, P.x, P.y, P.x + 200, P.y + 14) Then
Begin
ChatText := LowerCase(GetChatBoxText(MK, clBlue));
ChatName := LowerCase(GetChatBoxText(MK, clMessage));
If (ChatText = '') Then Exit;
If (Pos(Players[CurrentPlayer].Nick, ChatName) <> 0) Then Exit;
If (LastRespond = ChatText) Then
If (GetSystemTime - LastTIMEresponded < 60000) Then Exit;
Result := True;
Break;
End
End;
If Not Result Then Exit;
TempRespond := Responder;
QIndex := -1;
For MK := 0 To High(Responder) Do
Begin
For I := 0 To High(Responder[MK].Q) Do
Begin
TempRespond[MK].Q[I] := Replace(TempRespond[MK].Q[I], '$nick',
Players[CurrentPlayer].Nick);
If (Pos(Responder[MK].Q[I], ChatText) <> 0) Then
Begin
FinalRespond := Responder[MK].A[Random(GetArrayLength(
TempRespond[MK].A))];
QIndex := 100;
Break;
End;
End;
If (QIndex > -1) Then Break;
End;
If (QIndex = -1) Then
Begin
Result := False;
Exit;
End;
ChatName := Replace(ChatName, ':', '');
FinalRespond := Replace(FinalRespond, '$chatter', ChatName);
Skill := [':)', 'attack', 'strength', 'defence', 'range', 'prayer', 'magic',
'runecrafting', 'hitpoints', 'agility', 'herblore', 'thieving',
'crafting', 'fletching', 'slayer', 'mining', 'smithing', 'fishing',
'cooking', 'firemaking', 'woodcutting', 'farming'];
For MK := 1 To 21 Do
Begin
If (Players[CurrentPlayer].level[MK] = 0) Then
GetAllLevels;
FinalRespond := Replace(FinalRespond, '$'+Skill[MK],
IntToStr(Players[CurrentPlayer].Level[MK]));
End;
WriteLn(ChatName + ' says: ' + ChatText + '. ' + Players[CurrentPlayer].Name +
' responds with: ' + FinalRespond + ' (' + IntToStr(GetSystemTime - TsysTime)
+ ' ms.)');
TypeSend(FinalRespond);
RespondsMade := RespondsMade + 1;
End;

Procedure Respond;
Begin
AutoRespond(3);
End;

iRun

2009-11-20 14:22:36

Thanks, I'll go try it out, assuming I don't make any dumb mistakes.

wesleyxD

2009-11-21 02:23:48

Failed when compiling
Line 68: [Hint] (12053:1): Variable 'HOLDER' never used in script SCAR 3.22\includes\SRL\SRL\Core\CAutoRespond.scar
Line 133: [Hint] (12118:1): Variable 'TEMPRESP' never used in script SCAR 3.22\includes\SRL\SRL\Core\CAutoRespond.scar
Line 404: [Error] (21991:11): Duplicate identifier 'BUTTONCLICK' in script SCAR 3.22\Scripts\POMS\Essence Miner\POMS Essence Miner [ Run me ].scar

MasterKill

2009-11-21 03:25:57

From: wesleyxD
Failed when compiling
Line 68: [Hint] (12053:1): Variable 'HOLDER' never used in script SCAR 3.22\includes\SRL\SRL\Core\CAutoRespond.scar
Line 133: [Hint] (12118:1): Variable 'TEMPRESP' never used in script SCAR 3.22\includes\SRL\SRL\Core\CAutoRespond.scar
Line 404: [Error] (21991:11): Duplicate identifier 'BUTTONCLICK' in script SCAR 3.22\Scripts\POMS\Essence Miner\POMS Essence Miner [ Run me ].scar


:o the error is because the script you are running is using the same name for a button!

I'll try to give my variables some "rare" names to make sure then won't be found again as a duplicate one

I changed the function name, but I guess it will just crash now on another default form function.

oh and gee, I guess this wont work if there is an other form in the script.

Gu3st...

2009-11-21 03:59:03

Just rename all the functions and procedures to MK_+the last name.
Hopefully that will work :)

MasterKill

2009-11-21 04:26:41

From: Zyt3x
Just rename all the functions and procedures to MK_+the last name.
Hopefully that will work :)


Hmm, I allways had problems with that in the past, but now it seems like it works fine :o

<–>

Replace version 2 in the first post please :)

Gu3st...

2009-11-21 04:36:33

Oh, and try to not to use frmDesign :p
Good job :)

Daniel

2009-11-22 03:20:12

Hehe,

So did you actually manage to test this yourself? (BTW, sorry :\)

Glad it still works ;)

NiCbaZ

2009-11-23 17:35:52

Wow looks very nice.

Simtoon

2009-11-25 07:38:09

Long time no see…

RAM

2009-11-26 22:35:03

works very well :)

MasterKill

2009-11-27 01:29:37

Thanks for testing RAM :)

I noticed the get text function result sometimes is something like ,,-.,-,,.–,-, I would have to make a failsave for that and then I might make an official release ;)

RAM

2009-11-27 11:16:29

From: MasterKill
Thanks for testing RAM :)

I noticed the get text function result sometimes is something like ,,-.,-,,.–,-, I would have to make a failsave for that and then I might make an official release ;)


Yeah, I noticed a few other bugs also..and maybe you could include a small tutorial on how to set up your responses using $chatter and skills ?…I've yet to get it to respond with the chatter's name ?

chook

2009-12-02 12:58:15

Sorry for the question, but do i run this the same time as a script?

MasterKill

2009-12-02 16:07:08

When you have replaced the file in the srl folder, the auto responder should automatically start with any srl based script you run. Tough note that the actual responder will only work when the scripter has used "FindNormalRandoms;" in there script.

noidea

2009-12-02 23:22:14

Nice to see you back at SRL. How's your PHP going?

MasterKill

2009-12-03 01:05:22

From: noidea
Nice to see you back at SRL. How's your PHP going?


Not really back tough, this is an old script and it seems like it still works. maybe when my training period is over I might have some time for SRL again.

PHP is awesome :) love MySQL, did some big projects already. Going good :D Thanks for asking.

FEAR

2009-12-05 12:01:19

Err I get this error :confused:

[PHP]
[Runtime Error] : Out of Global Vars range in line 38 in script C:\SCAR\includes\SRL\SRL\Core\CAutoRespond.scar
[/PHP]

Edit: Another one which I have never seen before

[php]
[Runtime Error] : Invalid Opcode in line 36 in script C:\SCAR\includes\SRL\SRL\Core\CAutoRespond.scar
[/php]

Perhaps I am doing something wrong.