Log in

View Full Version : simba - simba



Le Jingle
04-12-2012, 08:52 AM
Forgive me if this is a stupid question, but is nil only used in setting up simba? Or does it have use in common scripts?

Ex.


{$ifdef Simba}
{$loadlib irokiplugin}
var
Bladieblatempthingy : TForm;
procedure CreateFormBladieblatempthingy;
begin
Bladieblatempthingy := TForm.Create(nil);
end;
{$endif}


E: Er, title may be misleading, file path is:

Simba > Includes > SRL > srl > core > simba.simba

Le Jingle
04-12-2012, 01:10 PM
Also, another question;

program New;
{$DEFINE SMART}
{$DEFINE SRL5}
{$i srl/srl.simba}

begin
SendKeys(37, 200); // Key to send, wait time
end.

I get "Type mismatch at line 7", where sendkeys is, but I don't know what I'm doing wrong as I'm following the example.. :s

masterBB
04-12-2012, 01:15 PM
I don't understand your first question.

Answer to your second question.
program New;

begin
SendKeys('Hello there!', 200); // Key to send, wait time
end.

It requires a string, not a number.

Le Jingle
04-12-2012, 04:34 PM
Ah thanks, I didn't check to see if it said string >.>

And I think I forget what I was trying to get at with the first question... :x

Le Jingle
04-12-2012, 06:00 PM
Hmm, I'll ask another question here that hopefully may be looked upon and answered;

Given my 2nd question, I'm trying to make a potential antiban suggestion;

I'm thinking it has something to do with either my repeating method (how I used flight's label idea) or how I use the KeyUp/Down..


// Synthesized from help via MasterBB, Flight, R1ch, Nebula and Wizzup?
procedure RandomArrowKeyAngleToggle;
var
StartAngle, PressKeyz, i, a: integer;
label
Start; //Flight guided
begin
FindNormalRandoms;
StartAngle := round(rs_GetCompassAngleDegrees());
Start:
PressKeyz:= RandomRange(50, 65);
i:= random(4);

begin
case (i) of
1: begin
KeyDown(VK_Left); // MasterBB guided
KeyUp(VK_Left);
end;
2: begin
KeyDown(VK_Right);
KeyUp(VK_Right);
end;
3: begin
KeyDown(40);
KeyUp(40);
end;
4: begin
KeyDown(38);
KeyUp(38);
end;
end;
Inc(a);
end;

if (a<PressKeyz) then
goto Start

else if (a=PressKeyz) then
begin
MakeCompass(StartAngle);
end;
end;


However when I run, my player will login, then idle/press a key, then just have the cam spin in circles until it reaches the "a=PressKeyz"

Ideally I'm aiming to have the arrow keys be hit any # of times in the specified RandomRange, as to replicate how a bored human would toggle random arrow keys on a laptop..

Any help appreciated.

masterBB
04-13-2012, 09:43 AM
Didn't test it, but I think this would work.

procedure RandomArrowKeyAngleToggle;
var
StartAngle, NumberOfSwitches, Key, i: integer;
begin
FindNormalRandoms;
StartAngle := round(rs_GetCompassAngleDegrees);
NumberOfSwitches:= RandomRange(2, 4);
for i := 0 to NumberOfSwitches do
begin
Key := RandomRange(37,40);
KeyDown(Key);
wait(RandomRange(200,1000));
KeyUp(Key);
end;
MakeCompass(StartAngle); //Maybe also SetAngle?
end;

Echo_
04-13-2012, 03:40 PM
About your first question:
nil is used as a value for objects, it's the equivalent of null in many object-oriented languages. Since Simba is not object-oriented, you'll mostly see it in scripts with forms.