Legends of the Jedi Forums Share Yo’ Scripts Mudlet Scripts/Aliases/Triggers
This topic has 2 replies, 1 voice, and was last updated 11 years, 7 months ago by Siradril.
Viewing 3 posts - 1 through 3 (of 3 total)
    • Siradril Participant
      September 18, 2012 at 3:44 am #19881

      Hey guys, ever since I switched to Mudlet I noticed that Beep did not function on Mudlet. Like people would beep you but you’d not hear the sound. So I decided to write a trigger that will play a sound for us, here is what I’ve done for this:

       

      Create a new Item on the Triggers menu. Name it Beep (You can name it whatever)

      Then underneath the name there will be various slots you can fill to trigger a code we’ll shortly write. I used three slots;

      ^.\(OOC\) .* beeps

      ^.\(RPC\) .* beeps

      ^.\(IMM\) .* beeps

      Write those three down on each slot and make sure they are set to Perl Regex, otherwise it won’t work.

      Once we’ve added the trigger slots, we’ll go down to the Code which looks like;

      playSoundFile([[./sounds/beep.mp3]])

      —– Now as those of you who uses Mudlet would know that the program is still far from finished, and when it comes to sound files it is particularly nasty. Because we are not able to pause or stop a sound that Mudlet started playing, however the best part of this code is that it plays the sound only once. Why did I say this? Well you can put any mp3 file or perhaps wav file instead of the beep.mp3. However if you put a sound file that is rather long, then it may get annoying after a time should people mass beep you, since you can’t stop it. The only option would be to either mute the sound from Windows or to Shutdown the Mudlet.

      Furthermore, how this code works: Basically what this does is enter the sounds directory under your Mudlet. (I’m not sure if it existed before, I may have made it up.) But yeah create a directory called sounds. Then move the beep.mp3 file into this directory.

      I didn’t have much time to look for a sound and the only other one I had was the Imperial March so I got into this site:

      http://soundbible.com/tags-alert.html

      And downloaded an alert sound.

      Anyhow that is all! I’ll write more stuff as I think of them along the way.

    • Siradril Participant
      September 18, 2012 at 4:21 am #19882

      Apparently we are not able to edit our posts, I forgot to include my thanks to Baxtalo and Henk for constantly beeping me to figure it out.

      Before I write down the next thingy, I want to let you all know that I’m not responsible in anyway should these scripts, triggers, aliases fail you or get you permed. I personally don’t prefer using combat scripts, so the ones I post will usually be aligned towards miscelleneous stuff or related to engineering etcetra. If you are using Mudlet, have an idea about a new script but can’t write it, feel free to send me a PM or ask for it here.

      Up next is a Tracker script, which is basically designed to track your target until you get there. The only exception is if the target is hiding or not on the planet (aka failure). Which can easily be remedied, don’t know why I never bothered to write a script for it.

      Anyhow we are clicking on Triggers again, and creating a new item called Tracker.

      Under the first slot you’ll type in;

      You sense a trail (\w+) from here

      And make sure to set it to Perl Regex.

      The code will look like this;

      trackdir = matches[2]

      send(trackdir)

      expandAlias (“trackt”)

       

      trackdir is the name of our variable, which basically captures the direction of our target from the trigger.  And then the script forces the alias to be activated once more.

      Now what we require are 2 Aliases, so click on the Aliases button and create a new name. Lets call it Tracker. You may change the -Alias Name- to whatever you desire. However down below you need to set the Pattern to this;

      ^trackt$

      and below that in the script window you need to write;

      send (“Track ” .. target)

      Now this was our first alias. However for this entire system to function we need one more alias, an alias that allows us to set the target. For that we once more click on Add Item and call it Target. Then underneath at the pattern we type:

      ^t (.*)$

      Below that at the script side we type in;

      target = matches [2]

      echo(“Target set to ” .. target .. “.”)

      —————————————————————————

      How this works is simple. For instance you are hunting down Walldo, you type t Walldo. Mudlet sets your target variable to Walldo. Once it is completed you type trackt which stands for track target. Mudlet sends the command “track Walldo” to the gameworld. If it gets a positive response, you receive a message saying You sense a trail west from here… Then the script automatically moves towards west. The Script is designed to do this over and over again until you are in the same room with the target.

      I figured I may as well completed the program by typing a fail check on the track. But then I realized something. If your target is not on the planet with you then the Mudlet would keep trying to track over and over again, spam continously until you change the target to someone who is there with you in the same room or if we disabled the Mudlet scripts briefly. And that doesn’t feel like a safe choice.

      So my suggestion is, use the code like this and if you know for sure that your target is here then put on goggles and type trackt until you get the success message.

    • Siradril Participant
      September 18, 2012 at 4:36 am #19883

      For today the third thing I’ll be submitting is an alias. This alias basically helps me calculate to designated locations without having to type showplanet to acquire the planets. We’ll click on the aliases button and then click on Add Item. Name it whatever you desire, I named it calculation. But then set the Pattern to this;

      ^calcto (.*)$

      At the script tab you need to type these;

      —————–

      planets={

      ald= { sector= “Alderaan”, coords=”1800 1800 3300″},

      ark= { sector= “Perave”, coords=”300 300 300″},

      bes= { sector= “Anoat”, coords=”8603 -45531 23232″},

      core={ sector= “Corellian”, coords=”1267 -10300 21512″},

      coru={ sector=”Coruscant”, coords=”300 300 300″},

      dan= { sector= “Raioballo”, coords=”15300 -3900 600″},

      kas= { sector=”Mytaranor”, coords=”3600 3600 3600″},

      kuat={ sector= “Kuat”, coords=”9699 9699 9699″},

      lor= { sector=”Kanz”, coords=”4300 4300 4300″},

      nab= { sector= “Chommell”, coords=”300 300 300″},

      nar= { sector= “Hutt”, coords=” -35500 -2919 -12510″},

      nal= { sector= “Hutt”, coords=”12700 4950 -600″},

      nim= { sector= “Meridian”, coords=”-15618 9214 21312″},

      ord= { sector= “‘Bright Jewel'”, coords=”300 300 300″},

      ryl= { sector= “Ryloth”, coords=”8285 7900 -19200″},

      tat= { sector= “Tatoo”, coords=”2700 2700 2700″},

      wro= { sector= “Wroona”, coords=”300 300 300″}

      }

      send (“calculate ” .. planets[matches[2]].sector .. ” ” .. planets[matches[2]].coords)

       

      —————–

      You need to type calcto coru on the cockpit or navigation room to make your script calculate to Coruscant’s at 300 300 300. The alias is case sensitive, so if you type something like calcto Coru the alias would fail. The idea is simple for the names. I use the first three letters unless there are more than 1 planet starting with the same 3 letters in which case we use the fourth, like in; coru(Coruscant), core(Corellia). The only exception was Kuat, somehow I typed the entire name I guess it felt more simple for me.

      You guys can change the alias trigger easily. All you need to do is change calcto to whatever you want. Just make sure not to change it to something you may later on need to send to the game world manually. And to change the planet names you need to change those 3-4 lettered characters to whatever you want.

      I guess for today this is all I will be uploading. I’ve been working on a chat tab for a while, but It’s quite hard and I’m a bit lazy. Once it is completed, I’ll upload it and I hope it’ll be grand.

      Cheers

Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.