-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathosrsspam.simba
56 lines (48 loc) · 958 Bytes
/
osrsspam.simba
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Spam MSG onto Old School RuneScape
// written by: Black Jordan
program OSRSSpam;
const
ENTER = 13;
TIMES = 1337;
SIXSECONDS = 6000; // ms
MSG = 'glow2: Hello world!';
PROGNAME = 'Old School RuneScape';
var
i : Integer;
function FindAndSetTarget(TitlePrefix: String; SetAsTarget: Boolean): Boolean;
var
T: TSysProcArr;
I: Integer;
begin
T:= GetProcesses();
for I := 0 to high(T) do
if ExecRegExpr('^' + TitlePrefix, T[i].Title) then
begin
Result := True;
if SetAsTarget then
begin
SetTarget(T[i]);
ActivateClient;
end;
end;
end;
function Spam(message : String) : Boolean;
begin
Result := FindAndSetTarget(PROGNAME, True);
if Result then
begin
SendKeys(message, 100, 100);
PressKey(ENTER);
Wait(SIXSECONDS);
end;
end;
procedure Mainloop;
begin
for i := 0 to TIMES do
begin
Spam(MSG);
end;
end;
begin
Mainloop;
end.