SRL Archive - RS3 Outdated / Broken Scripts

QuickSymbols ¯¯¯ By Widget


Widget

2007-06-23 20:11:10



Well yesterday I noticed that I was able to use alt-codes in Runescape, so just for the hell of it, I made a scar script.

It's a form (a real form). Keep it open. When you close the form, the script ends. It's not a setup form, it is the program :)

It can use F1 through F12, though some will be reserved by your internet browser. I just did this so you can use it on other things like AIM or MSN.

Oh, it also auto-saves and auto-loads. Since finding all 12 of your symbols would be quite bothersome.

Smartzkid

2007-06-23 20:26:26

¬¡¿¯¯¦™©²

:p Nice; Seems like firefox reserves a lot of fkeys though…

(love the form btw)

PS: It'd be nice if you could see the text in the listboxes without having to mouseover it

Widget

2007-06-23 20:43:32

From: Smartzkid
PS: It'd be nice if you could see the text in the listboxes without having to mouseover it


Hmm… Maybe it's my WindowsBlinds. Can you post a screenie? ;)

I edited a screenshot of what it looks like on my computer into the first post. Maybe my computer's just being stupid >.<

Smartzkid

2007-06-23 20:45:40

I have default xp theme on this computer

PS: What windowsblinds theme do you have?

Widget

2007-06-23 20:50:19

Ok, I see what happened. I'm using VistaXP, but it's inverted, so black text automatically got converted to white so I forgot to force it to be red :p

It should work now =)

PS: SCAR looks awesome like this except for the icons (attached). Edit: It got tiny, uploaded lol: here.

Smartzkid

2007-06-23 20:53:17

Wicked sick!

Except for the icons…
EDIT:

Works perfect now; I just had a great idea…I think you'll like it alot…will post back in a few when I finish it

EDIT: Finished!

program QuickSymbols;

var WidgetForm:TForm;
Codes:array[1..12] of TComboBox;
Background,Close:TImage;
Listener:TTimer;
f,t:integer;
Closed:boolean;

function GetAltCode(code:string):string;
begin
case code of
'©': Result := '0169';
'½': Result := '0189';
'&#8482;': Result := '0153';
'²': Result := '0178';
'³': Result := '0179';
'°': Result := '0176';
'ü': Result := '0252';
'Ü': Result := '0220';
'®': Result := '0174';
'¿': Result := '0191';
'¡': Result := '0161';
'¢': Result := '0162';
'£': Result := '0163';
'¥': Result := '0165';
'¦': Result := '0166';
'¬': Result := '0172';
'¯': Result := '0175';
end;
end;

Procedure Fade(window, speed: integer; direction: boolean);
{By Smartzkid
Window: Handle of the window to fade
Speed: Speed of the fade
Direction: True = fade in, False = fade out}
var
i: integer;
begin
case direction of
true: begin
repeat
i := i + speed;
MakeWindowTransparent(window, i);
wait(25);
until(i >= 255)
end;
false: begin
i := 255;
repeat
i := i - speed;
MakeWindowTransparent(window, i);
wait(25);
until(i <= 0)
end;
end;
end;

procedure SaveSettings(Sender: TObject; var CanClose: Boolean);
begin
if (not FileExists(AppPath+'QuickSymbols.ini')) then
begin
t := RewriteFile(AppPath+'QuickSymbols.ini',False);
CloseFile(t);
end;
for t := 1 to 12 do
WriteIni('QuickSymbols','F'+IntToStr(t),Codes[t].text,AppPath+'QuickSymbols.ini');
end;

procedure ReadSettings;
begin
if FileExists(AppPath+'QuickSymbols.ini') then
for t := 1 to 12 do
Codes[t].text := ReadIni('QuickSymbols','F'+IntToStr(t),AppPath+'QuickSymbols.ini');
end;

procedure ListenForFs(Sender:TObject);
var i:integer;
begin
try
f := f + 1;
if (f>12) then
f := 1;
if IsFKeyDown(f) then
begin
repeat
sleep(50);
until (not IsFKeyDown(f));
if (length(Codes[f].text)=1) then
begin
KeyDown(18);
sleep(10+random(20));
for i := 1 to 4 do
begin
KeyDown(StrToIntDef(GetAltCode(Codes[f].text)[i],0)+96);
sleep(10+random(20));
KeyUp(StrToIntDef(GetAltCode(Codes[f].text)[i],0)+96);
sleep(10+random(20));
end;
KeyUp(18);
end;
end;
except writeln('out of string range =('); end;
end;


procedure DragForm(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var sx,sy,tx,ty:integer;
begin
getmousepos(tx,ty);
repeat
getmousepos(sx,sy);
WidgetForm.Top := WidgetForm.Top - (ty-sy);
WidgetForm.Left := WidgetForm.Left - (tx-sx);
sleep(1);
tx := sx;
ty := sy;
until (not IsMouseButtonDown(True));
end;

procedure CloseForm(Sender:TObject);
begin
Fade(WidgetForm.Handle, 5, false);
WidgetForm.ModalResult := mrOk;
Closed := true;
end;
procedure MakeForm;
begin
WidgetForm := CreateForm;
with WidgetForm do
begin
SetBounds(0,0,85,325);
Position := poScreenCenter;
BorderStyle := bsNone;
Onclosequery := @SaveSettings;
end;
Background := TImage.Create(WidgetForm);
with Background do
begin
Parent := WidgetForm;
SetBounds(0,0,85,325);
OnMouseDown := @DragForm;
with Canvas do
begin
t := BitmapFromString(1, 325, 'z78DA33301891C0621492060D0D4' +
'624B41859D0C870142241CB51880E8D0D4721FD200080B6818A');
SafeCopyCanvas(GetBitmapCanvas(t),Background.Canvas,0,0,1,325,0,0,85,325);
Pen.Color := $1F1F1F;
for t := -20 to 65 do
begin
MoveTo(0,t*5);
LineTo(84,t*5+84)
MoveTo(84,t*5);
LineTo(0,t*5+84)
end;
Pen.Color := $0000FF; // red
MoveTo(0,0);
LineTo(84,0);
LineTo(84,324);
LineTo(0,324);
LineTo(0,0);
Brush.Style := bsClear;
Font.Color := $0000FF;
Font.Style := [fsBold];
for t := 1 to 12 do
TextOut(4,t*25+4,'F'+IntToStr(t)+':');
end;
end;
for t := 1 to 12 do
begin
Codes[t] := TComboBox.Create(WidgetForm);
with Codes[t] do
begin
Parent := WidgetForm;
SetBounds(30,t*25-2,50,20);
Color := 0;
Items.Add('©');
Items.Add('®');
Items.Add('½');
Items.Add('&#8482;');
Items.Add('²');
Items.Add('³');
Items.Add('°');
Items.Add('ü');
Items.Add('Ü');
Items.Add('¿');
Items.Add('¡');
Items.Add('¢');
Items.Add('£');
Items.Add('¥');
Items.Add('¦');
Items.Add('¬');
Items.Add('¯');
Font.Size := 10;
Font.Name := 'Arial';
Font.Color := $0000FF;
end;
end;
Listener := TTimer.Create(WidgetForm);
Listener.OnTimer := @ListenForFs;
Listener.Interval := 25;
t := BitmapFromString(12, 12, 'z78DA9DD25172C4200806E02' +
'B2948844711BCFF91AA6467BAD9ACDDB679F82703E48B61C28506' +
'0D1FADB7EE5D58D89B80C087145656CFE4E4959225B35EB122E6A' +
'C594571E030A7345B3F26130C18E8F39638A779991529C206054A' +
'AAAB222B521FEFB3F668C764E59525EAD6D0D0AC8282F2F13D73D' +
'79E0589B65838C7C569D0CEF9BB7617CEC98743EF9D8B5622E955' +
'F8BDF338033D39E96FCEFD2B767B7B713AF6E9CCDF62B787DDDE2' +
'E0E63C65C6D06EE849D76C4F630DEAEBE12A24EE1D7F1398BAECC' +
'F1146254781E52F094FF95404BF802FEC5B434');
Close := TImage.Create(WidgetForm);
Close.Parent := WidgetForm;
Close.SetBounds(68,4,12,12);
Close.OnClick := @CloseForm;
SafeCopyCanvas(GetBitmapCanvas(t),Close.Canvas,0,0,12,12,0,0,12,12);
FreeBitmap(t);
ReadSettings;
end;

procedure SafeShowWF;
var
tva: TVariantArray;
begin
setarraylength(tva, 0);
ThreadSafeCall('MakeForm', tva);
end;

procedure ShowForm;
begin
WidgetForm.SHOW;
end;

procedure SafeShowForm;
var
tva: TVariantArray;
begin
setarraylength(tva, 0);
ThreadSafeCall('ShowForm', tva);
end;

procedure ShowFormModal;
begin
WidgetForm.ShowModal;
end;

procedure SafeShowFormModal;
var
tva: TVariantArray;
begin
setarraylength(tva, 0);
ThreadSafeCall('ShowFormModal', tva);
end;

procedure Form;
begin
SafeShowWF;
MakeWindowTransparent(WidgetForm.Handle, 0);
SafeShowForm;
Fade(WidgetForm.Handle, 5, true);
WidgetForm.HIDE;
SafeShowFormModal;
FreeForm(WidgetForm);
end;

begin
Fade(GetSelf.Handle, 5, false);
Form;
Fade(GetSelf.Handle, 5, true);
end.

Probably not the cleanest way to do it (look at the Form procedure :p), but it works, and it works pretty well…

EDIT:

Will return once I fix the dragging problem

Fixed the dragging problem, but it flickers after it's finished fading in…

Widget

2007-06-23 21:50:40

Hmm, I'll play around with it ;)

Also, I added a crapload more symbols to try out. Post any invalid ones that don't show up on Runescape lol.

Edit: It won't render after every frame with sleep/wait. I'll have to put it on a timer. But good idea! :)

Stevee

2007-06-29 13:54:27

not too manyu things work for me lol. does GetSelf or GetApplication or stuff like that only work on srl 3.7?