Author Topic: Stealth Trainer  (Read 3344 times)

0 Members and 1 Guest are viewing this topic.

Offline AhzmandiusTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Activity:
    0%
  • Reputation Power: 1
  • Ahzmandius has no influence.
  • Gender: Male
  • Referrals: 0
    • View Profile
Stealth Trainer
« on: November 08, 2021, 10:19:16 PM »
Starts with a simple hide loop if skill is under 25.0, otherwise walks back and forth while staying hidden. Pauses script if no stealth gains are seen within 5 minutes(Probably need to increase armour). Also keeps track of skill delay for failed/successful hides. Trains to max skill value, enjoy :)

Code: [Select]
function trainStealth(){
Orion.RemoveTimer('lastGain');
Orion.ClearJournal();
while(Orion.SkillValue('Stealth', 'real') < Orion.SkillValue('Stealth', 'cap')){
if(Orion.InJournal('Your skill in Stealth')){
Orion.ClearJournal('Your skill in Stealth');
Orion.SetTimer('lastGain');
}
if(Orion.Timer('lastGain') > 600000){
Orion.Print('No stealth gains in 5 minutes, try adding armor.');
Orion.PauseScript();
}
var stealth = Orion.SkillValue('Stealth');
var hiding = Orion.SkillValue('Hiding');
if(hiding < 250){
Orion.Print('Starting from scratch, buy skill if possible.');
do {
Orion.UseSkill('Hiding');
Orion.Wait(8000);
} while(Orion.SkillValue('Hiding') < 250);
}
while(!Orion.BuffExists('Hiding')){
                        if(Orion.TimerExists('lastHide'){
    while(Orion.Timer('lastHide') < 10000)
Orion.Wait(50);
                        }
Orion.UseSkill('Hiding');
Orion.Wait(1000);
if(Orion.InJournal('You fail to hide')){
Orion.ClearJournal('You fail to hide');
Orion.SetTimer('lastHide');
}
if(Orion.InJournal('You have hidden')){
Orion.ClearJournal('You have hidden');
Orion.SetTimer('lastHide', 4000);
}
}
var px = Player.X();
Orion.WalkTo(px - 3, Player.Y(), Player.Z(), 0, 2, 0);
Orion.WalkTo(px, Player.Y(), Player.Z(), 0, 2, 0);
}
}

Got this up and running to train a new toon. Skills are currently going up and i ran out of glitches to fix, still a long ways to go.

**Edit: Script was getting held up if the lastHide timer was never set(First run of script). That's been fixed.
« Last Edit: February 08, 2022, 10:33:12 AM by Ahzmandius »

Offline Crisis

  • Global Moderator
  • *
  • *
  • Posts: 2997
  • Activity:
    3.2%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Referrals: 2
    • View Profile
Re: Stealth Trainer
« Reply #1 on: November 09, 2021, 03:04:03 AM »
Good stuff! Thank you for sharing!

Offline AhzmandiusTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Activity:
    0%
  • Reputation Power: 1
  • Ahzmandius has no influence.
  • Gender: Male
  • Referrals: 0
    • View Profile
Re: Stealth Trainer
« Reply #2 on: November 09, 2021, 06:56:46 PM »
Can't wait to show off my next creation. Ive been getting a little better at Javascript. Also learned how to make custom gumps, work with data files, and store persistent variables in the registry with Orion. Its gonna be a Biggun!

Tags: