EvilChicken!
2008-06-27 20:13:04
- Logging out in FindMod should be removed. Script writer should decide what would happen if a mod/admin is detected.
- RC no longer works, JaGex replaced Friends chars with new, unique ones. Check out my temp fix.
- SetChat coords are not working.
- InConvo in AntiRandoms.scar allwars returns true.
- FindFightEx is a replacement function for FindFight in AntiRandoms.scar.
- My SetOption replaces both SetRun and Retaliate in GameTab.scar, and also has support for the other options, such as "chat effects", "mouse buttons" ect.
Please comment on anything you can think of.
function InConvoEx: Boolean;
var
X, Y: Integer;
begin
Result := (not FindColor(X, Y, 0, 9, 459, 31, 471) and LoggedIn);
end;
procedure SetOption(Which: string; TurnOn: Boolean);
var // Replaces SetRun and Retaliate in GameTab.SCAR and adds more options.
MBox: TBox;
XY: TPoint;
begin
if not LoggedIn or NoGameTab then exit;
case LowerCase(Which) of
'retaliate': begin
XY := IntToPoint(664, 358);
MBox := IntToBox(570, 360, 715, 399);
end;
'mousebuttons', 'mouse buttons': begin
XY := IntToPoint(585, 357);
MBox := IntToBox(568, 358, 603, 394);
end;
'chat effects', 'chateffects', 'chat effect', 'chateffect': begin
XY := IntToPoint(644, 357);
MBox := IntToBox(624, 359, 659, 394);
end;
'split private', 'splitchat', 'spilt private chat': begin
XY := IntToPoint(692, 357);
MBox := IntToBox(679, 358, 715, 393);
end;
'aid', 'accept aid': begin
XY := IntToPoint(588, 450);
MBox := IntToBox(568, 413, 603, 447);
end;
'run': begin
XY := IntToPoint(622, 421);
MBox := IntToBox(624, 413, 659, 448);
end;
else
begin
SRL_Warn('SetOption', '"' + Which + '" is not a valid option', Warn_AllVersions);
Exit;
end;
end;
if LowerCase(Which) = 'retaliate' then GameTab(1) else GameTab(11);
if GetColor(XY.X, XY.Y) = 10551295 then // Pop-up-shit.
begin
MouseBox(551, 452, 778, 497, 3);
FTWait(2 + random(3));
end;
if (GetColor(XY.X, XY.Y) = 987203) xor TurnOn then
MouseBox(MBox.X1, MBox.Y1, MBox.X2, MBox.Y2, 1);
end;
procedure SetChatEx(State: string; Chat: Byte); // Replaces SetChat in FlagChat.SCAR.
var// Also, small thingy: Integer variable should be replaced with Byte var in ChatsOff.
Color: Integer;
X1X2: TBox;
begin
if (LowerCase(State) = 'hide') and (Chat > 1) then
begin
srl_Warn('SetChatEx', 'State "' + Capitalize(State) +
'" is not available for chat(' + IntToStr(Chat) + ') ', warn_AllVersions);
Exit;
end;
case Chat of
1: X1X2 := IntToBox(122, 171, 145, 0);
2: X1X2 := IntToBox(178, 228, 200, 0);
3: X1X2 := IntToBox(236, 284, 260, 0);
4: X1X2 := IntToBox(294, 342, 320, 0);
5: X1X2 := IntToBox(350, 398, 373, 0);
else
begin
srl_Warn('SetChatEx', 'Chat(' + IntToStr(Chat) + ') does not exist ', warn_AllVersions);
Exit;
end;
end;
case LowerCase(State) of
'on': Color := 65280;
'off': Color := 255;
'hide': Color := 16776960;
'friends': Color := 65535;
else
begin
srl_Warn('SetChatEx', 'State "' + Capitalize(State) + '" does not exist ', warn_AllVersions);
Exit;
end;
end;
if not FindColorSpiral(X1X2.X2, X1X2.X2, Color, X1X2.X2 - 10, 486, X1X2.X2 + 10, 506) then
begin
MouseBox(X1X2.X1, 482, X1X2.Y1, 500, 2);
Wait(175 + random(175));
ChooseOption(Capitalize(LowerCase(State)));
end;
end;
const // Constants for RCEx;
RC_Master = ''; // RC master.
RC_Reset = 'reset'; // Reset all players to active | command.
RC_Deactivate = 'kthxbai'; // Deactivate ONLY current player | command.
RC_Terminate = 'stop'; // Terminate script | command.
RC_LogOut = 'logout'; // Log out current player | command.
function RCEx: Boolean; // Removed all non-working commands, added one. Works now.
var // Doesn't wait for command, nor replies. I think it's much more efficient that way.
X, Y: Integer;
begin
if (Trim(RC_Master) = '') or (not FindColor(X, Y, 128, MCX1, MCY1, MCX2, MCY2)) then exit;
MasterBitMapMask := CreateBitmapMaskFromText(RCMaster, SmallChars);
if (not FindBitmapMaskTolerance(MasterBitMapMask, X, Y, MCX1, MCY1, MCX2, MCY2, 10, 6)) then
begin
try
FreeBitmap(MasterBitMapMask);
except end;
Exit;
end;
case RCReadCommand of
RC_Reset: begin
RCResetStatus;
Result := True;
end;
RC_LogOut: begin
Logout;
Result := True;
end;
RC_Deactivate: begin
LogOut;
Players[CurrentPlayer].Active := False;
Result := True;
end;
RC_Terminate: begin
if random(2) = 1 then LogOut;
try
FreeBitmap(MasterBitMapMask);
except end;
TerminateScript;
end;
end;
try
FreeBitmap(MasterBitMapMask);
except end;
end;
function FindFightEx: Boolean;
var
X, Y: Integer;
CurTab: Byte;
begin
if (not FindColor(x, y, 65280, 230, 130, 280, 180) or
not FindColor(x, y, 255, 230, 130, 280, 180)) then exit;
CurTab := GetCurrentTab;
if CheckHpFirst then
if HPPercent <= 100 then exit;
Result := True;
WriteLn('******** FOUND FIGHTING RANDOM ********');
WriteFileString(TheFile, '******** FOUND FIGHTING RANDOM ********' + Chr(13));
GameTab(CurTab);
TakeScreen('Found fight');
Inc(Fights);
end;I repeat, please let me know anything that is on your mind regarding this.