Hi all.
I am looking at writing another tutorial for Aerolib for those who want to learn more.
I would love to know what people want to learn next (basics and items already covered!), so post your suggestions here!
Hi all.
I am looking at writing another tutorial for Aerolib for those who want to learn more.
I would love to know what people want to learn next (basics and items already covered!), so post your suggestions here!
Hey Dan, long time no see!
Now that you've covered the basics, items etc, would something more intermediary be in order? Perhaps debugging/failsafe stuff like TPA/ATPAs, things that make scripts easier to condense/work with (such as records), but I know we've already got those kinds of tutorials around here and they work fine.
Maybe just useful info on Aerolib; stuff like antiban, randomization, breaking... idk. Just a thought (sorry if you've covered this already, I haven't read your tuts in a while).
I would just like to say that your first two tutorials were extremely helpful, and I really think you covered a lot of important aspects in the game
I think you should make a tutorial something that covers what you think are some of there more important aspects of scripting; whats the most useful and used besides what you covered?
I also think if you could go over dismissing randoms that could be helpful, I found your first to guides very helpful though so whatever you think you should do would be great. Thanks a bunch for contributing!
Hey Dan
please do one on breaking and dismissing Randoms. This would be so helpful to me.
Aerolib does have a built in break system, but I have never attempted to use it; I usually build my own. Here is a simple function that you could use:
Simba Code://function HandleMyBreak(BreakTime, randomVar: Integer):boolean;
//Breaktime = time in milliseconds.
//RandomVar = variation (+/-) in milliseconds.
//
function HandleMyBreak(BreakTime, randomVar: Integer):boolean;
var
BreakTimer: Timer;
begin
BreakTime := randomrange(BreakTime - randomVar, BreakTime + randomVar);
BreakTimer.start();
While (BreakTimer.TimeElapsed < BreakTime) do
begin
ClearDebug;
writeln('Break finishing in: ' +msToTime((BreakTime - BreakTimer.TimeElapsed), Time_Formal));
wait(100);
end;
Result := true;
end;
Can be called like so:
Simba Code:HandleMyBreak(100000, 10000);
// Or
if HandleMyBreak(100000, 10000) then
writeln('Break finished.');
Dear Dan thanks for the help ive always used the aerolib breaking system. But the problem that i'am having with it the system is that i cant get it to log me back in after the break. for example.
start script
it will say 1:21 mins till break
then 1:21 mins will go by
then it will break for a random number of mins
then after the break is done it wont log me back in.
what am i doing wrong?
Good point. You need to check and see if your player is logged in, and if not, log them in.
See amended code:
Simba Code:function HandleMyBreak(BreakTime, randomVar: Integer):boolean;
var
BreakTimer: Timer;
begin
BreakTime := randomrange(BreakTime - randomVar, BreakTime + randomVar);
BreakTimer.start();
While (BreakTimer.TimeElapsed < BreakTime) do
begin
ClearDebug;
writeln('Break finishing in: ' +msToTime((BreakTime - BreakTimer.TimeElapsed), Time_Formal));
wait(100);
end;
if not IsLoggedIn then
LoginPlayer(false);
Result := true;
end;
or if you wanted to use the Aerolib break system, simply add the following somewhere in your code, after declaring the break:Simba Code:if not IsLoggedIn then
LoginPlayer(false);
Last edited by Dan the man; 08-28-2017 at 03:26 AM.
thanks for the help dan i still struggled with using breakHandler in aerolib but when i used your function everthing work good.
Simba Code:function randomsCheck(): Boolean;
begin if not isLoggedIn() then Exit(false);
if levelUpEx(False) then Exit(true);
if continueChat(false) then Exit(true);
// if getHealthPercent() <= 30 then
//begin
//Shutdown := True;
//sdReason := 'Critical health reached';
//result := True;
//end;
result := waitEx(50);
end;
i've been using this function to dismiss randoms. i saw flight use this in his runecrafter lite. and i was wondering if this was the right way to dismiss randoms. im pretty sure this isn't right at all. i thought maybe the if continueChat(false) then Exit(true); is how to dismiss randoms. but im pretty sure that is wrong.
also one more thing could you make a guide on how to install aero 2.0 and simba 1.2 i cant seem to figure it out. The problem that im running into is that i cant figure out how to update simba 1.2. i downloaded it. but i dont understand how to re-install simba form the 1.2 download file or just to update simba into 1.2. so my question is what do you do after you download 1.2 to get simba to update?
Last edited by underforu; 08-28-2017 at 06:08 AM.
for finding and responding a certain string to a PM, would I use uptext or uptextpa?
A tutorial or snippet for this would help tons
I believe that findTalk is a function that searches for and dismisses randoms.
You need to setup your players nick name:
Simba Code:Me.Active := true;
Me.name := 'OurEmailAddress@Whatever.com';
Me.Pass := 'MyPassword';
Me.Nick := 'iggi'; //Part of our character name in game (not the first letter).
Me.Pin := '';
Me.Member := true;
You can then put this function randomly though your script. Ideally in places where you are waiting for a rock to b mined, a bow to be fletched or another part of your script where you aren't doing anything.
Simba Code:findTalk();
In a procedure like so:
Simba Code:procedure WaitingForStuff;
begin
Repeat
writeln('This is an example procedure.');
findTalk();
writeln('We just searched for chat referencing our nickname.');
Until(FinishedMakingBows);
end;
Last edited by Dan the man; 08-28-2017 at 11:59 PM.
First of all you'll want to setup BreakHandler when you initialize your script, somewhere under initAL(). Also don't forget to declare your username/password/member status, however this is done before initAL(). Then, you just place this single line of code any time you want the script to check if it's time for a break yet or not (this can be called constantly or, if you prefer, at specific places within the script):
Simba Code:breakHandler();
And here is a perfect example of setting it up correctly:
Simba Code:program TimeForMeToTakeABloodyBreak;
{$i AeroLib/AeroLib.Simba}
procedure declareMyPlayer();
begin
Me.Name := 'S A X';
Me.Pass := 'gowerftw';
Me.Member := True;
Me.Active := True;
end;
begin
declareMyPlayer();
initAL();
// Break in / break for / +/- (random) break in / +/- (random) break for
setupBreak(10, 5, 7, 3);
repeat
breakHandler(); // breakHanlder(True); if you'd like it to switch worlds upon logging back in
wait(500);
until(false);
end.
Since I disabled dismissing randoms via WaitEx you can simply call this in your script whenever you want to check for randoms, as in moderators & P-Mods talking nearby as well as random event NPCs who are, at the moment, saying your username:
Simba Code:foundRandoms();
or...
if foundRandoms() then writeln('Found a random/mod!');
foundRandoms() will right-click 'Dismiss' the random NPC, or if a moderator is found, logout and terminate the script.
Current projects:
[ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]
"I won't fall in your gravity. Open your eyes,
you're the Earth and I'm the sky..."
okay thanks for the help guys but what about installing simba 1.2 and the new aerolib could you guys share some light on that?
Yeah just download this (if you are windows).
Open c:/simba
Find simba.exe in this folder and delete it or rename it to something like simba old.exe or something.
Drag the file you downloaded into this folder and rename it to simba.exe
That's all you need to do.
There are currently 1 users browsing this thread. (0 members and 1 guests)