Jump to content
clickhere

Runtime Error?

Recommended Posts

wWell, then you didn't put it in the right folder... Try passing an absolute path to the function.

 

I wanted the script not to be tied down to just him. So he could pass it on. Originally it was an absolute path, I changed it to includes path though. App path pointed at C:/Program Files/. Try putting it in My Documents->SCAR Divi->Includes folder. Make sure it says IncludesPath + 'Codes.txt' in the script.

 

Also you can post the script if you want. It doesn't matter to me

Link to comment
Share on other sites

[scar]{~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~

_ _ _____ _ _ ______ _ _ _ _

| | | |/ ____| | | | | ____| (_) | | /\ | | | |

| |__| | (___ | |__| | | |__ _ __ _ ___ _ __ __| | / \ __| | __| | ___ _ __

| __ |\___ \| __ | | __| '__| |/ _ \ '_ \ / _` | / /\ \ / _` |/ _` |/ _ \ '__|

| | | |____) | | | | | | | | | | __/ | | | (_| | / ____ \ (_| | (_| | __/ |

|_| |_|_____/|_| |_| |_| |_| |_|\___|_| |_|\__,_|/_/ \_\__,_|\__,_|\___|_|

 

Version: 1.0

By: LordJashin32

Last Updated: 8/26/12

 

------------------------------------------------------------------------------------

 

Directions:

1. Put a file called Codes.txt in the same directory

as this Script file (HSH Friend Adder)! This file should

contain all the friend codes you wish to add! ONLY

the codes, nothing more or this won't work!

 

2. Open HighSchool Hero on your iPhone over TightVNC (only!)

 

3. Go to the friends area, where you input friend codes

 

4. Use the Crosshairs on SCAR Divi to select HSH

on TightVNC!

 

`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~

 

Copyright 2012 LordJashin32 All Rights Reserved

 

`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~}

 

{$IFNDEF SCAR335_UP}

{$ERROR You need SCAR 3.35 or higher to run this script! You can get SCAR Divi at www.scar-divi.com}

'You need SCAR 3.35 or higher to run this script! You can get SCAR Divi at http://www.scar-divi.com'

{$ENDIF}

 

program Highschool;

 

var

Client: TSCARWindowClient;

a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, Backspace, Add: TPoint;

GlobalFileSize: Integer;

EntryPoint: TPoint;

w, h: Integer;

Codes: string;

 

const

CodeLength = 8;

 

procedure SetupClient;

begin

Client := TSCARWindowClient(GetClient);

ActivateWindow(Client.Handle);

GetWindowSize(Client.Handle, w, h);

end;

 

procedure SetupButtons;

begin

EntryPoint := Point(160, 195);

a0 := Point(162, 448);

a1 := Point(50, 287);

a2 := Point(164, 296);

a3 := Point(268, 297);

a4 := Point(50, 335);

a5 := Point(156, 351);

a6 := Point(268, 348);

a7 := Point(59, 400);

a8 := Point(162, 399);

a9 := Point(267, 397);

Backspace := Point(269, 457);

Add := Point(292, 244);

end;

 

function ReadCodes: string;

var

OpenCodes: Integer;

s: string;

begin

OpenCodes := OpenFile(IncludesPath + 'Codes.txt', true);

ReadFileString(OpenCodes, s, FileSize(OpenCodes));

GlobalFileSize := FileSize(OpenCodes);

Result := Ansistring(s);

CloseFile(OpenCodes);

end;

 

procedure TypeCode(Code: string);

var

i: Integer;

CheckKeypad: TSCARBitmap;

x, y: Integer;

begin

if Length(Code) <> 8 then Exit;

 

CheckKeypad := TSCARBitmap.Create('deNrt0VtqwzAQBdDsohvqukvTvBTJer/sNIspg' +

'n64aAY0RAJTDAd/JXfuRe+Ht4MN3yQuPiGPIi01G2cYLf/Z0s34BwmSsxRQZxM' +

'yjJZP7tlCuwWSC59q1C1I/vJCN5SyMyQVLtbAgQUtf36hG0qaDImFDTVwYEHLz' +

'9SeLSadIKEwvkbdguSnlm5CRRLsXYTyQjuCPnczNWcNe5fRW7D3Wv+Gy0CC3PJ' +

'cOq4sQZ+75P4N3OgtLe6T78EW0hD0ufsHE47kxi1EM2HYpAn63LXUnLXr3UDU6' +

'C3IXTNgi/nd0vgVZsSWC9P9yObvEOeb2m3Q6Sp3G/R1mf6N41nsNujzxDfl48h' +

'ALf/9AR6lo+I=');

SetMousePos(EntryPoint.x, EntryPoint.y);

ClickMouse(EntryPoint.x, EntryPoint.y, mbLeft);

Repeat

i := i + 1;

wait(1000);

if i = 5 then begin

CheckKeypad.free

Exit;

 

end;

until (i = 5) or FindBitmapTol(x, y, CheckKeypad, 0, 0, w - 1, h - 1, 10);

 

i := 0;

CheckKeypad.Free;

{ for i := 0 to 15 do

begin

SetMousePos(backspace.x, backspace.y);

ClickMouse(backspace.x, backspace.y, mbLeft);

wait(100);

end;}

for i := 1 to 8 do

begin

case StrToInt(Copy(Code, i, 1)) of

0:

begin

SetMousePos(a0.x, a0.y);

ClickMouse(a0.x, a0.y, mbleft);

end;

1:

begin

SetMousePos(a1.x, a1.y);

ClickMouse(a1.x, a1.y, mbleft);

end;

2:

begin

SetMousePos(a2.x, a2.y);

ClickMouse(a2.x, a2.y, mbleft);

end;

3:

begin

SetMousePos(a3.x, a3.y);

ClickMouse(a3.x, a3.y, mbleft);

end;

4:

begin

SetMousePos(a4.x, a4.y);

ClickMouse(a4.x, a4.y, mbleft);

end;

5:

begin

SetMousePos(a5.x, a5.y);

ClickMouse(a5.x, a5.y, mbleft);

end;

6:

begin

SetMousePos(a6.x, a6.y);

ClickMouse(a6.x, a6.y, mbleft);

end;

7:

begin

SetMousePos(a7.x, a7.y);

ClickMouse(a7.x, a7.y, mbleft);

end;

8:

begin

SetMousePos(a8.x, a8.y);

ClickMouse(a8.x, a8.y, mbleft);

end;

9:

begin

SetMousePos(a9.x, a9.y);

ClickMouse(a9.x, a9.y, mbleft);

end;

end;

Wait(100);

end;

SetMousePos(Add.x, Add.y);

ClickMouse(Add.x, Add.y, mbLeft);

end;

 

procedure CheckIfAdded;

var

bmp, Bmp1: TSCARBitmap;

i, x, y: Integer;

begin

Bmp1 := TSCARBitmap.Create('deNpdlHlQ03caxr8xIEWQKkcIOSAHuQgQLrcga' +

'3GqwCpTVwXd6q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7tBV/ecZsuuq/xWcO2pRyr8s50lzPSUusiqM' +

'HylROg19XxEzbFb5xoESEue8gSWunmLl6HlWK+tfjoVZ4W+o0bcczNWV3wdnWq' +

'zDyGqDydvVA6/HMqviQyumVApllVwTGwX0zFUk69TpmYhhVCub6xVAuWPc4HU2' +

'ZKar7t/AvEY0B6/LvC2qeXzCdzHRxz7IrAuOoSghFscLDSV9XGUefiGZTlBtOd' +

'eJp3PNyX+lVj30Mvdr6e7Cd66tXzZnqQEFq1Pgzy64IipGPIU9pfk5NYhgqBf/' +

'IbggaP9JNI5wdSd0/XHIaDUjSPjTYd7MY25HMjA/1dWBSkN1V68//spryj/p/v' +

'e4yG+HXtRUPG7YkoFIoviuABoBFQ301tnVt1+VP7BoVnEiQvtfjge8bGmokp7L' +

'ZyYspBxYFuTt8ty3s4tl2RbA4hCf2wq7B94hWLT65n/XcfPbGiKGye6gnB25d4' +

'aREd5w/buvpcltMela5idcAwwYU3z7Qq310l78nFTngkMdLPcLnJIRTMWhX1AQ' +

'QNA524iL1g1KPw44Xs+we/61XJXn7rVIBnrXRIMvPrVs5R5q7z9ohcg5ruy+eE' +

'2XvGLx93d6vxLeVbbS3sIATOxdpIDCfu4O6TeBmCdoVtQFMSYTKAhxMPA6UDk5' +

'pfWWZEWPBr4PDSG25YNdLICA5uMvS2uQ2m/oKC7CYEP6mWMWnH1h42Jiis+vkA' +

'eSAQ968zYjIiasZaIn8D4fAONj+cWBx8zpzs8zcetAYJx8Ye3ounGmKeQocBFu' +

'T1b8UG8ofyXOyuFF00OCvWSTZvlG8bUNLdChywGFMTpUwz7T6TDgw7dSRDjN3x' +

'UQcy4PE0bxqvnTvlsEfC3X3bxse/6m7V9Lz0dHWtUuoUrTGzhckMfiR9EkHBr1' +

'tWQjlgOMzhuGToc+sCHPjvzfD/rs=');

wait(1000);

Repeat

if FindBitmapTol(x, y, bmp, 0, 0, w - 1, h - 1, 10) or FindBitmapTol(x, y, bmp1, 0, 0, w - 1, h - 1, 10) then

begin

SetMousePos(x, y);

ClickMouse(x, y, mbLeft);

bmp.Free;

bmp1.Free;

Exit;

end;

SetMousePos(234, 400);

ClickMouse(234,400,mbLeft);

i := i + 1;

wait(1000);

until (i = 5);

if i = 5 then

begin

bmp.Free;

bmp1.Free;

WriteLn('Failed to find OKAY button so we have no idea if anything is being typed in');

//TerminateScript;

end;

end;

 

procedure DeleteCode(Code: string);

var

OpenCodes: Integer;

begin

Delete(Codes, Pos(Code, Codes), 8);

DeleteFile(IncludesPath + 'Codes.txt');

OpenCodes := RewriteFile(IncludesPath + 'Codes.txt', True);

WriteFileString(OpenCodes, Codes);

GlobalFileSize := FileSize(OpenCodes);

CloseFile(OpenCodes);

 

end;

 

procedure CheckIfWindowIsOpen;

var

w1, h1: Integer;

begin

GetWindowSize(TSCARWindowClient(GetClient).Handle, w1, h1);

if (w1 <> w) or (h1 <> h) then

begin

ShowMessage('Window is not open so I terminated the script');

TerminateScript;

 

end;

end;

 

procedure ReadAndTypeCodes;

var

CurrentCode: string;

from: Integer;

i: Integer;

begin

from := 1;

Codes := ReadCodes;

Codes := GetNumbers(Codes);

i := 1;

Repeat

CheckIfWindowIsOpen;

CurrentCode := Copy(Codes, from, CodeLength);

TypeCode(CurrentCode);

CheckIfAdded;

from := from + CodeLength;

DeleteCode(CurrentCode);

until (from > GlobalFileSize);

end;

 

begin

ClearDebug;

SetupButtons;

SetupClient;

ReadAndTypeCodes;

end.[/scar]

Edited by Freddy
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...