PDA

View Full Version : sorry realised this was wrong section



N1234
01-20-2014, 11:27 AM
sorry realised this was wrong section

The Mayor
01-20-2014, 11:41 AM
sorry realised this was wrong section


program scriptForLeecher;

{$DEFINE SMART}
{$I SRL-6/SRL.simba}


const
message1 = 'Type here 1';
message2 = 'Type here 2';
message3 = 'Type here 3';
message4 = 'Type here 4';
message5 = 'Type here 5';


procedure declarePlayers;
begin
setLength(players, 1);
with players[0] do
begin
loginName := 'zezima';
password := 'SRLisTheBest';
isActive := true;
end
currentPlayer := 0;
end;

begin
clearDebug();
setupSRL;
declarePlayers;
players[currentPlayer].loginToLobby;

if lobby.isOpen then
lobby.openTab(LOBBY_CHAT)
else
writeLn('Lobby isn''t open for some reason!');

typeSend(message1, true);
typeSend(message2, true);
typeSend(message3, true);
typeSend(message4, true);
typeSend(message5, true);

end.

N1234
01-20-2014, 11:56 AM
wow thank you so much, i dont know how you read it that quick before i realised it was for private server requests. if you dont mind, after it finishes typing the messages, the script stops and it types pretty fast, is there anyway that i am able to set a duration in seconds between messages sent and keep repeating? but other than that i am totally blown away as this is almost the exact script i was dreaming of 5 minutes ago. THANK YOU!!!

The Mayor
01-20-2014, 09:06 PM
wow thank you so much, i dont know how you read it that quick before i realised it was for private server requests. if you dont mind, after it finishes typing the messages, the script stops and it types pretty fast, is there anyway that i am able to set a duration in seconds between messages sent and keep repeating? but other than that i am totally blown away as this is almost the exact script i was dreaming of 5 minutes ago. THANK YOU!!!

That will honestly take 20 seconds to do ;)


Look into the following:


repeat

until(false);


it repeats everything between the repeat and until. The false just means is will keep repeating forever.

and


wait(1000);


it waits 1 second (1000 ms) before moving on. You change to what ever time you want.

You would want to put all the typeSend statements inside the repeat loop, and you would want to add the wait statement in-between each one ;)

N1234
01-20-2014, 09:18 PM
i got it and it works perfectly! exactly how i imagined! thank you so much!! 2 thumps up you rock!