Log in

View Full Version : Keep getting same error on text.scar



opeth dm
09-24-2007, 11:58 PM
This error keeps coming up with a powerchopping i'm trying to use.


function FindChatText(txt: string): Boolean; //Chat(1)
var
x, y: integer;
begin
Result := FindText(x, y, txt, SmallChars, MCX1, MCY1, MCX2, MCY2);
end;



Line 712: [Error] (3077:43): Unknown identifier 'MCX1' in script C:\Program Files\SCAR 3.12\includes\SRL/SRL/Core/Text.scar
Failed when compiling

I replaced mcx1, mcy1, mcx2, and mcy2 with xs, ys, xe, ye and it seems to not complain anymore.

But this next one...



function ClickNpcChatText(txt: string; Left:Boolean): Boolean;
var
tx, ty, S: Integer;
begin
if txt <> '' then
begin
S := CreateBitmapMaskFromText(txt, npcchars);
if FindBitmapMaskTolerance(S, tx, ty, 9, 348, 523, 471, 50, 10) then
begin
if Left then
Mouse(tx + 5, ty + 8, 0, 0, True)
else
Mouse(tx + 5, ty + 8, 0, 0, False)
Result := True;
end;
FreeBitmap(S);
end
else
Result := False;
end;


Line 289: [Error] (289:1): Unknown identifier 'Mouse' in script C:\Program Files\SCAR 3.12\includes\SRL\SRL\Core\Text.scar
Failed when compiling

I don't know what it wants me to change 'mouse' to..


Any help?



And yes, i'm updated with SRL 4, and SCAR 3.12

IronTeapot
09-25-2007, 12:05 AM
do you have SetupSRL; at the start of your main loop?

opeth dm
09-25-2007, 12:30 AM
There is not a SetupSRL; anywhere in this text.

Where would I stick it at?

//-----------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//-- ยป Text Routines --//
//-----------------------------------------------------------------//
// * procedure TypeByte(k: Byte); // * by Mutant Squirrle
// * procedure TypeSend(Text: String); // * by Mutant Squirrle
// * function SendText2(Text: String): Boolean; // * by RSN | Modded By: Spky
// * procedure SendText(Text: String); // * by RSN
// * function GetUpText: String; // * by WT-Fakawi
// * function IsUpText(UpText: String): Boolean; // * by Masquerader
// * function IsUpTextMulti(UT1, UT2, UT3: String): Boolean; // * by WT-Fakawi
// * function IsUpTextMultiCustom(Text: TStringArray): Boolean; // * by Starblaster100
// * function FindText(var cx, cy: Integer; txt: String; font, xs, ys, xe, ye: Integer): Boolean; // * by Stupid3ooo
// * function FindNpcChatText(txt: String): Boolean; // * by Kernel Klink or Stupid3000, font by Masquerader
// * function ClickNpcChatText(txt: String): Boolean; // * by Kernel Klink or Stupid3000, font by Masquerader
// * function FindInventoryText(txt: String): Boolean; // * by Stupid3ooo
// * function ChooseOption(txt: String): Boolean; // * by Stupid3ooo, modded by Sumilion
// * procedure CloseWindow; // * by Stupid3ooo
// * function hitkeys(send: Boolean): Integer; // * by Pyro
// * function HumanText(Text: String; Chance: Integer): String; // * by Pyro
// * function TextCoords(textn: Integer): TPoint; // * by Wizzup?
// * function LastChatter(var name: String): Boolean; // * by masquerader
// * function GetLastChatText(var chat: String): Boolean; // * by masquerader
// * procedure FixChat; // * by WT-Fakawi
// * function SaveToChatLog: Boolean; // * by WT-Fakawi / masquerader
// * function GetNewChatMsg: String; // * by Stupid3ooo
// * function ClearSpaces(Text: String): String; // * by Mad Cow
// * function InChat(Text: String): Boolean; // * by WT-Fakawi
// * function InChatMulti(Text1, Text2, Text3: String): Boolean; // * by WT-Fakawi
// * function FindChatText(txt: String): Boolean; // * by Stupid3ooo
// * Function GetUpTextColor(Color, Tol: Integer; Range: TCharRange): String; // * by Wizzup?
// * Function ChatsBlackText: Array Of String; // * by Wizzup?
// * function IsChatBlackTextAnyLine(ChatTxt: String): Boolean; // * by Wizzup?
// * Function GetBlackChatMessage: String; // * by Wizzup?
// * Function FindBlackChatMessage(ChatMsg: String): Boolean; // * by Wizzup?
// * function PopUp(Option: String): Boolean; // * by RsN
// * function ClickOption(s: String; i: Integer): Boolean; // * by Starblaster100
// * function ClickText2(txt: String; font, xs, ys, xe, ye: Integer; left: Boolean): Boolean; // * by Stupid3ooo


{ var TheFile: Integer;
Description: Use to log chat to file. See SaveToChatLog. }
var
TheFile: Integer;

{var OldLine,TheLine, TheName: String;
Description: ChatLog vars. }
var
OldLine, TheLine, TheName: string;

{************************************************* ******************************
procedure TypeByte(k: Byte);
By: Mutant Squirrle
Description: Types one char.
************************************************** *****************************}

procedure TypeByte(k: Byte);
begin
KeyDown(k);
Wait(10 + Random(50));
KeyUp(k);
end;

{************************************************* ******************************
procedure TypeSend(Text: String);
By: Mutant Squirrle
Description: Types text humanlike using random timeing on keys.
************************************************** *****************************}

procedure TypeSend(Text: string);
var
i: Integer;
Shift: Boolean;
begin
for i := 1 to Length(Text) do
begin
Shift := (Text[i] = ':') or (Text[i] = '!') or (Text[i] = '+') or
(Text[i] = '?') or (Text[i] = '<') or (Text[i] = '>') or
(Text[i] = '@') or (Text[i] = '#') or (Text[i] = '$') or
(Text[i] = '&') or (Text[i] = '%') or (Text[i] = '*');
if (Shift) then
begin
KeyDown(VK_Shift);
Wait(5 + Random(20));
end;
TypeByte(GetKeyCode(Text[i]));
if (Shift) then
begin
KeyUp(VK_Shift);
Wait(5 + Random(20));
end;
Wait(50 + Random(120));
end;
Wait(200 + Random(500));
TypeByte(13);
end;

{************************************************* ******************************
function SendText2(Text: String): Boolean;
By: RSN | Modded By: Spky
Description: Types text humanlike making mistakes, returns true if mistake has
been made.
************************************************** *****************************}

function SendText2(Text: string): Boolean;
var
i, j, w: Integer;
S: string;
begin
for i := 1 to Length(Text) do
begin
S := Text[i];
if (Random(5) + 1 = 1) and (w < 3) then
begin
w := w + 1;
Result := True;
j := Ord(S[1]);
if (j <> 13) then
S := Chr(j + (Random(5) + 1));
if (S = Chr(13)) then
S := 'l';
end;
SendKeys(S);
Wait(50 + Random(100));
end;
end;

{************************************************* ******************************
procedure SendText(Text: String);
By: RSN
Description: Types text humanlike.
************************************************** *****************************}

procedure SendText(Text: string);
var
i: Integer;
begin
for i := 1 to Length(Text) do
begin
SendKeys(Text[i]);
Wait(50 + Random(100));
end;
end;

{************************************************* ******************************
function GetUpText: String;
By: WT-Fakawi
Description: Returns text in upperleft corner.
************************************************** *****************************}

function GetUpText: string;
var
Speed: Integer;
begin
Speed := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
Result := GetTextAtEx(7, 7, 100, upchars, True, True, 0, 2, -1, 50, False,
tr_AllChars);
ColorToleranceSpeed(Speed);
end;

{************************************************* ******************************
function IsUpText(UpText: String): Boolean;
By: Masquerader
Description: Returns up text that might be to the right
************************************************** *****************************}

function IsUpText(UpText: string): Boolean;
var
tempx, tempy, Speed: Integer;
begin
Speed := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
if (IsTextInAreaEx(7, 7, 334, 20, tempx, tempy, UpText, 100, upchars, True,
True, 0, 2, -1)) then
Result := True;
ColorToleranceSpeed(Speed);
end;

{************************************************* ******************************
function IsUpTextMulti(UT1, UT2, UT3: String): Boolean;
By: WT-Fakawi
Description: Returns any of three UpText that might be to the right
Usefull when text is partially masked.
Use: IsUpTextMulti('Att','tta','ack')
************************************************** *****************************}

function IsUpTextMulti(UT1, UT2, UT3: string): Boolean;
var
tempx, tempy, I, Speed: Integer;
var
TheText: string;
begin
Speed := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
for I := 1 to 3 do
begin
case I of
1: TheText := UT1;
2: TheText := UT2;
3: TheText := UT3;
end;
if IsTextInAreaEx(7, 7, 334, 20, tempx, tempy, TheText, 100, upchars, True,
True, 0, 2, -1) then
begin
Result := True;
ColorToleranceSpeed(Speed);
Exit;
end;
end;
ColorToleranceSpeed(Speed);
end;

{************************************************* ******************************
function IsUpTextMultiCustom(Text: TStringArray): Boolean;
By: Starblaster100
Description: Similar to IsUpTextMulti but you can input as many strings in an
array as you like
Use: IsUpTextMultiCustom(['Att', 'ttac', 'ack', 'monst', 'ster'])
************************************************** *****************************}

Function IsUpTextMultiCustom(Text: TStringArray): Boolean;
var
i, TempX, TempY, Speed: Integer;
Begin
Speed := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
For i := 0 to GetArrayLength(Text)-1 do
Begin
if(IsTextInAreaEx(7, 7, 334, 20, TempX, TempY, Text[i], 100, UpChars, True,
True, 0, 2, -1))then
begin
Result := True;
Break;
end;
end;
ColorToleranceSpeed(Speed);
end;

{************************************************* ******************************
function FindText(var cx, cy: Integer; txt: String; font, xs, ys, xe, ye: Integer): Boolean;
By: Stupid3ooo
Description: Searches for text in specified box with specified font.
************************************************** *****************************}

function FindText(var cx, cy: Integer; txt: string; font, xs, ys, xe, ye:
Integer): Boolean; //by Stupid3ooo
var
S: Integer;
begin
S := CreateBitmapMaskFromText(txt, font);
if xs <= 0 then xs := 0;
if ys <= 0 then ys := 0;
Result := FindBitmapMaskTolerance(S, cx, cy, xs, ys, xe, ye, 10, 50);
FreeBitmap(S);
end;

{************************************************* ******************************
function FindNpcChatText(txt: String): Boolean;
By: Kernel Klink or Stupid3000, font by Masquerader
Description: Get last chat message.
************************************************** *****************************}

function FindNpcChatText(txt: string): Boolean;
var
S, x, y: Integer;
begin
S := CreateBitmapMaskFromText(txt, npcchars);
Result := FindBitmapMaskTolerance(S, x, y, 9, 348, 523, 471, 50, 10);
FreeBitmap(S);
end;

{************************************************* ******************************
function ClickNpcChatText(txt: String): Boolean;
By: Kernel Klink or Stupid3000, font by Masquerader
Description: Get last chat message.
************************************************** *****************************}

function ClickNpcChatText(txt: string; Left:Boolean): Boolean;
var
tx, ty, S: Integer;
begin
if txt <> '' then
begin
S := CreateBitmapMaskFromText(txt, npcchars);
if FindBitmapMaskTolerance(S, tx, ty, 9, 348, 523, 471, 50, 10) then
begin
if Left then
Mouse(tx + 5, ty + 8, 0, 0, True)
else
Mouse(tx + 5, ty + 8, 0, 0, False)
Result := True;
end;
FreeBitmap(S);
end
else
Result := False;
end;

{************************************************* ******************************
function FindInventoryText(txt: String): Boolean;
By: Stupid3ooo
Description: Finds inventory text.
************************************************** *****************************}

function FindInventoryText(txt: string): Boolean; ////Small(3)
Var
x, y: integer;
begin
Result := FindText(x, y, txt, SmallChars, 553, 206, 742, 465);
end;

{************************************************* ******************************
function ChooseOption(txt: String): Boolean;
By: Stupid3ooo, modded by Sumilion
Description: Finds Popup menu, then clicks on it.
************************************************** *****************************}

function ChooseOption(txt: string): Boolean;
var
x1, y1, x2, y2, LeftCorner, RightCorner, x, y: Integer;
begin
LeftCorner := BitmapFromString(4, 4, 'z78DA33753135313137C5' +
'411A600064715CEA914500CACE13F0');
RightCorner := BitmapFromString(4, 4, 'z78DA33753135313137' +
'C5200D30002E35F8C501C9C013F0');
if (FindBitmap(LeftCorner, x1, y1)) and (FindBitmap(RightCorner, x2, y2)) then
begin
if (FindText(x, y, txt, upchars, x1, y1, x2, 502)) then
begin
Result := True;
MouseBox(x1 + 5, y + 4, x2, y + 10, True);
end
else if (FindText(x, y, 'Cancel', upchars, x1, y1, x2, 502)) then
MouseBox(x1 + 5, y + 4, x2, y + 10, True);
end;
FreeBitmap(LeftCorner);
FreeBitmap(RightCorner);
end;

{************************************************* ******************************
function CloseWindow: Boolean;
By: Solemn Wishes and Starblaster100
Description: Closes any open windows.
************************************************** *****************************}

function CloseWindow: Boolean;
var
WindowType : array[0..1] of Integer;
i, x, y: Integer;
Begin
WindowType[0] := BitmapFromString2(False, 'a0714278DA8D8D410EC' +
'5200844AF840AE25FAA95FB1FE9337651135353174FF31846 220A' +
'A9911FBB1CA956A78CE2CC21823C4DC94EEE30D2063C31DEB A240' +
'B18CBF4D241C3568626D6E4D408AF626085C94D90EC8AB7FD E079' +
'F6577E9203D350F15780C07DD3D72F4E3BD7CCCE7332B3288 773C' +
'39A5CF93DF9B6B54FC524A67EF3AD7FCD9C93FBD6B96D9FFE 01BE' +
'1');
WindowType[1] := BitmapFromString2(False, 'aC16F978DA3DCB3B12002108' +
'03D02B4531B096ECC7FB1F49B285CD9B09090070BF05C20A7 A966' +
'E8F6C5D8E3CF66B6843B55CAEBB26F0A9DF980AC125D38E30 FE7E' +
'126D032D6');
for i := 0 to 1 do
begin
If(FindBitmapToleranceIn(WindowType[i], x, y, 470, 25, 505, 55, 25)) then
begin
Mouse(x, y, 4, 4, true);
Result := True;
Break;
end else
Wait(10);
end;
For i := 0 to 1 do
FreeBitmap(WindowType[i]);
end;

{************************************************* ******************************
function hitkeys(send: Boolean): Integer;
By: Pyro
Description: Hits Random 4 Keys that are random 4 dist away. Good for smelt or cook x
************************************************** *****************************}

function hitkeys(send: Boolean): Integer;
var
i, k: Integer;
full: string;
begin
i := Random(6) + 1;
for k := 1 to 4 do
full := full + IntToStr(i + Random(4));
Result := (StrToInt(full));
if (send) then TypeSend(IntToStr(Result));
end;

{************************************************* ******************************
function HumanText(Text: String; Chance: Integer): String;
By: Pyro
Description: Returns A text humanly. DOES NOT TYPE. But will make ACTUAL human Mistakes
Chance is like well think of it as 1 out of ......
************************************************** *****************************}

function HumanText(Text: string; Chance: Integer): string;
var
Keyboard: array[1..8] of string;
Tempi, i, l, NewKey: Integer;
Temps, Newtext: string;
begin
keyboard[1] := '1234567890-=';
keyboard[2] := 'qwertyuiop[]\';
keyboard[3] := 'asdfghjkl;';
keyboard[4] := 'zxcvbnm,./';
keyboard[5] := '!@#$%^&*()_+';
keyboard[6] := 'QWERTYUIOP{}|';
keyboard[7] := 'ASDFGHJKL:"';
keyboard[8] := 'ZXCVBNM<>?';
for l := 1 to Length(Text) do
begin
Temps := Copy(Text, l, 1)
if (Random(Chance) = 0) then
begin
for i := 1 to 8 do
begin
Tempi := Pos(Temps, keyboard[i])
if (tempi <> 0) then
begin
if (Tempi = 1) then NewKey := 2
if (Tempi = Length(keyboard[i])) then Newkey := Tempi - 1
if (Tempi <> 1) and (Tempi <> 10) then
Newkey := Tempi + Random(2) - Random(2)
NewText := Copy(keyboard[i], NewKey, 1)
Break;
end;
end;
end else Newtext := Temps
Result := Result + Newtext;
end;
end;


{************************************************* ******************************
Function TextCoords(textn: Integer): TPoint;
By: Wizzup?
Description: Returns x, y for text. (1 to 8)
************************************************** *****************************}

Function TextCoords(textn: Integer): TPoint;

Begin
textn := textn - 1;
Result.X := 12;
Result.Y := 347 + (14 * textn);
End;

{************************************************* ******************************
function GetUpTextColor(Color, Tol: Integer; Range: TCharRange): String;
By: Wizzup?
Description: Performs GetTextAtEx with The chosen color, tol and TCharRange.
************************************************** *****************************}

function GetUpTextColor(Color, Tol: Integer; Range: TCharRange): string;
begin
Result := Trim(GetTextAtEx(7, 7, Tol, upchars, True,
True, 0, 2, Color, 50, True, Range));
end;

{************************************************* ******************************
function ChatsBlackText: Array Of String;
By: Wizzup?
Description: Gets all text with color 0 in chatbox:
line 1 is result[0]
line 2 is result[1]
line 3 is result[2]
line 4 is result[3]
line 5 is result[5]
line 6 is result[6]
line 7 is result[7]
line 8 is result[8]
************************************************** *****************************}

function ChatsBlackText: array of string;
var
I: Byte;
tpa: TPointArray;
begin
SetArrayLength(tpa, 9);
for I := 1 to 8 do
tpa[i] := TextCoords(i);

SetArrayLength(Result, 9);
for I := 1 to 8 do
Result[I] := Trim(GetTextAtEx(tpa[i].x - 2, tpa[i].y - 2, 0, SmallChars, False,
False, 0, 1, 0, 80, False, tr_AllChars));
end;

{************************************************* ******************************
function IsChatBlackTextAnyLine(ChatTxt: String): Boolean;
By: Wizzup?
Description: Returns true if ChatTxt is found in any of the 8 lines in ChatBox.
************************************************** *****************************}

function IsChatBlackTextAnyLine(ChatTxt: string): Boolean;
var
TheLines: array of string;
I: Byte;
begin
TheLines := ChatsBlackText;
for I := 1 to 8 do
if (Pos(ChatTxt, TheLines[I]) <> 0) then
begin
Result := True;
Exit;
end;
end;

{************************************************* ******************************
function GetBlackChatMessage: String;
By: Wizzup?
Description: Gets text with color 0 in last chat line.
************************************************** *****************************}

function GetBlackChatMessage: string;
Var
TextP: TPoint;
begin
TextP := TextCoords(8);
Result := Trim(GetTextAtEx(TextP.X - 2, TextP.Y - 2, 0, SmallChars, False,
False, 0, 1, 0, 80, False, tr_AllChars));
end;

{************************************************* ******************************
function FindBlackChatMessage(ChatMsg: String): Boolean;
By: Wizzup?
Description: Returns True if text with color 0 in last chat line is found.
************************************************** *****************************}

function FindBlackChatMessage(ChatMsg: string): Boolean;
begin
Result := (Pos(ChatMsg, GetBlackChatMessage) <> 0);
end;

{************************************************* ******************************
function LastChatter(var name: String): Boolean;
By: masquerader
Description:Returns name and true if a person was talking, or false and the text
************************************************** *****************************}

function LastChatter(var name: string): Boolean;
var
i: Integer;
textP: TPoint;
begin
textP := TextCoords(8);
name := LowerCase(Trim(GetTextAtEx(textP.x - 2, textP.y - 2, 0, SmallChars, False, False, 0, 1,
0, 60, False, tr_allChars)))
i := Pos(':', name)
if (i <> 0) then
begin
Delete(name, i, i);
Result := True;
end;
end;

{************************************************* ******************************
function GetLastChatText(var chat: String): Boolean;
By: masquerader / Wizzup?
Description: Returns true if blue chat text was found
************************************************** *****************************}

function GetLastChatText(var chat: string): Boolean;
var
x, y: Integer;
textP: TPoint;
begin
textP := TextCoords(8);
if findcolor(x, y, 16711680, textp.x, textp.y, textp.x + 200, textp.y + 14) then
begin
chat := LowerCase(Trim(GetTextAtEx(x - 4, textp.y - 2, 0, SmallChars, False,
False, -1, 1, 16711680, 60, False, tr_allChars)));
Result := True;
end;
end;

{************************************************* ******************************
procedure FixChat;
by: WT-Fakawi
Description: Scrolls ChatText scrollbar down.
************************************************** *****************************}

procedure FixChat;
var
ScrollX, ScrollY: Integer;
begin
ScrollX := 485 + Random(4);
ScrollY := 422 + Random(4);
if (GetColor(486, 417) = 1646629) then
begin
MMouse(ScrollX, ScrollY, 0, 0)
while (GetColor(486, 417) = 1646629) do
begin
HoldMouse(ScrollX, ScrollY, True);
Wait(10);
end;
ReleaseMouse(ScrollX, ScrollY, True);
Wait(100);
end;
end;

{************************************************* ******************************
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
WriteFileString(TheFile, TheTime + ' '+TheName+':'+TheLine + Chr(13));
end else
begin
TheLine:=TheName;
if OldLine <> TheLine then
WriteFileString(TheFile, TheTime + ' '+TheLine + Chr(13));
end;
end;
{************************************************* ******************************
function GetNewChatMsg: String;
By: Stupid3ooo
Description: Get last chat message.
************************************************** *****************************}

function GetNewChatMsg: string;
begin
if (not (GetLastChatText(Result))) then
LastChatter(Result);
end;

{************************************************* ******************************
function ClearSpaces(Text: String): String;
By: Mad Cow
Description: Clears spaces in an area of text(Needed in 'GetXP');
************************************************** *****************************}

function ClearSpaces(Text: string): string;
var
Nums: string;
I, II: Integer;
begin
Nums := '01234567890';
for I := 1 to Length(Text) do
begin
for II := 1 to 10 do
begin
if (Copy(Text, I, 1) = Copy(Nums, II, 1)) then
Result := Result + Copy(Text, I, 1);
end;
end;
end;

{************************************************* ******************************
function InChat(Text: String): Boolean;
By: WT-Fakawi
Description: Grabs Last Chat Line and performs checks on occurence of text
************************************************** *****************************}

function InChat(Text: string): Boolean;
begin
Result := FindBlackChatMessage(Text);
end;
{************************************************* ******************************
function InChat(Text: String): Boolean;
By: WT-Fakawi
Description: Grabs Last Chat Line and performs checks on occurence of text
************************************************** *****************************}

function InBlackChat(Text: string): Boolean;
begin
Result := (Pos(Text, GetNewChatMsg) > 0);
end;

{************************************************* ******************************
function InChatMulti(Text1, Text2, Text3: String): Boolean;
By: WT-Fakawi
Description: Grabs Last Chat Line and performs checks on three occurences of text
************************************************** *****************************}

function InChatMulti(Text1, Text2, Text3: string): Boolean;
var
temp: string;
begin
temp := GetBlackChatMessage;
if (Pos(Text1, temp) <> 0) or (Pos(Text2, temp) <> 0) or (Pos(Text3, temp) <> 0) then
Result := True
end;

{************************************************* ******************************
function FindChatText(txt: String): Boolean;
By: Stupid3ooo
Description: Searches for text in chat window.
************************************************** *****************************}

function FindChatText(txt: string): Boolean; //Chat(1)
var
x, y: integer;
begin
Result := FindText(x, y, txt, SmallChars, xs, ys, xe, ye);
end;

{************************************************* ******************************
function ClickOption(s: String; i: Integer): Boolean;
By: Starblaster100
Description: Clicks Option in Specified Area (1 for Main Screen, 2 Inventory,
3 for Chat Window), returns True if text was found
************************************************** *****************************}

function ClickOption(S: string; i: Integer): Boolean;
var
x, y, tmpMask: Integer;
TempBox: TBox;
begin
tmpMask := CreateBitmapMaskFromText(S, upchars);
case i of
1:begin
TempBox.x1 := 0;
TempBox.y1 := 0;
TempBox.x2 := 520;
TempBox.y2 := 340;
end;
2:begin
TempBox.x1 := 520;
TempBox.y1 := 200;
TempBox.x2 := 750;
TempBox.y2 := 470;
end;
3:begin
TempBox.x1 := 0;
TempBox.y1 := 340;
TempBox.x2 := 500;
TempBox.y2 := 460;
end;
else
begin
Writeln('ClickOption Error: "'+IntToStr(i)+'" is not a valid option!');
exit;
end;
end;
if (FindBitmapMaskTolerance(tmpMask, x, y, TempBox.x1, TempBox.y1, TempBox.x2, TempBox.y2, 10, 50)) then
begin
Wait(25 + Random(50));
Mouse(x + (Length(S) * 6 div 2), y + 5, 3, 3, True);
Result := True;
end;
FreeBitmap(tmpMask);
end;

{************************************************* ******************************
function ClickText2(txt: String; font, xs, ys, xe, ye: Integer; left: Boolean): Boolean;
By: Stupid3ooo
Description: Clicks text if found in box.
************************************************** *****************************}

function ClickText(txt: string; font, xs, ys, xe, ye: Integer; left: Boolean): Boolean;
Var
x, y: integer;
begin
Result := FindText(x, y, txt, font, xs, ys, xe, ye);
if (Result) then
Mouse(x + Length(txt) * 3, y + 3, 0, 0, left);
end;

Sorry for the constant noobing teapot. It's probably annoying. :duh:

I just really want to start getting into scripting/autoing.

IronTeapot
09-25-2007, 12:35 AM
the setupsrl; goes in the script youre trying to run (the powerchopper in this case?) dont tell me youre trying to run the one you just posted above...

opeth dm
09-25-2007, 12:41 AM
Nope, i'm trying to run this [SRL4]Powerchopper.

This is the only spot where it says SetupSRL;



begin
SetupSRL;
ScriptId:= '296';
DeclarePlayers;
ClearDebug;
ActivateClient;
repeat
SetUpNextPlayer(false, false);
if not LoggedIn then Exit;
repeat
if InvFull then
begin
DropLogs;
If DropRandomItems then
begin
DropGems;
end;
Loads:= Loads + 1;
end;
Chop(PlayerTreeName);
Report;
until(Loads >= Players[CurrentPlayer].Integers[2]);
SetUpNextPlayer(true, false);
until(false);
end.

IronTeapot
09-25-2007, 12:45 AM
that should be working fine then, do you mind sendimg me the actual script youre using and ill try running it on my machine?

opeth dm
09-25-2007, 12:47 AM
Sure, PM your info.

Would it be a problem also since i'm running on Vista?

ckeboss
09-25-2007, 01:03 AM
try to reinstall scar 3.12 and make sure srl is right

gangsta-444
09-25-2007, 11:37 AM
have the same problem fellas...Please Help

hessels92
10-05-2007, 09:05 PM
i have same problem 2 please help

realrocker00
10-11-2007, 09:18 PM
Make sure that you have filled out everything that is nessecary in all of the right places.