1. Hey Guest, are you looking for a place to host your IRC related project? Then check out the Resource Manager on IRCForums! Click the resources tab above this notice!
  2. Hello Guest, are you new to IRCForums? Why not introduce yourself in the introduction forum!
  3. We have updated the layout of our forums. Please see this thread for more information.

[msl] Simple Away Script

Discussion in 'Script Gallery (Depreciated)' started by iownall555, Jan 8, 2012.

  1. Offline

    iownall555 Recruit

    Member Since:
    Dec 18, 2011
    Message Count:
    107
    Likes Received:
    16
    Trophy Points:
    21
    This is a small script I made which prompts you for an away reason and changes your nick to one you want. On the first run you will have to run it twice so it adds a variable. It will be fixed soon. Also remember to change NICKNAMEHERE with your desired nickname (The second NICKNAMEHERE should be your original nickname. ;). Run it with /as.

    Code (mirc):
    alias as {
      if (%ascriptenabled == $null ) {
        set %ascriptenabled == false
        .echo 9Variable added. You'll need to run 7/as 9again to use the script. This will be fixed soon.
        halt
        } elseif (%ascriptenabled == false ) {
     
        set %areyousure $?!="Do you wish to enable the away script?"
     
        if (%areyousure == $true) {
     
          set %awayreason $?="Please type your away reason."
          if (%awayreason == $null) {
            unset %awayreason
            unset %areyousure
            halt
          }
          away %awayreason
          set %ascriptenabled true
          .echo 9You are now away.
          .echo 9Reason:7 %awayreason 
          nick NICKNAMEHERE
          unset %awayreason
          unset %areyousure
          halt
          } elseif (%areyousure == $false) {
          unset %awayreason
          unset %areyousure
          halt
        }
     
        } elseif (%ascriptenabled = true) {
     
        set %areyousure $?!="Do you wish to disable the away script?"
     
        if (%areyousure == $true) {
          set %ascriptenabled false
          away
          .echo 9You are no longer away.
          nick NICKNAMEHERE
          unset %areyousure
          halt
          } elseif (%areyousure == $false) {
          unset %areyousure
          halt
        }
     
      }
     
    }
  2. Offline

    Bertrum ParadoxIRC

    Member Since:
    Dec 17, 2011
    Message Count:
    1,821
    Likes Received:
    243
    Trophy Points:
    188
    You know iownall555, you could set the NICKNAME things as variables, which can be changed via a menu.

    Like, change NICKNAMEHERE to %regnick

    And then add something like:

    Code (mirc):
    on *:load:
    set %regnick $$?="Choose a nickname"
    }
    And along with that add:
    Code (mirc):

    Menu Channel,Status {
    -
    Choose reg nick: set %regnick $$?="Choose a nickname"
    -
    }
     
    -------------------------------------
    Alternatively, a much easier way to do it would simple be:

    Have your away nick thing like this:
    Code (mirc):
        .nick $+($me,[Away])
    That will change your nick to include [away] at the end.

    Change your return nick thing to this:
    Code (mirc):
        .nick $remove($me,[Away])
    That will remove the [away]
  3. Offline

    Napa182 Moderator

    Member Since:
    Dec 18, 2011
    Message Count:
    222
    Likes Received:
    83
    Trophy Points:
    56
    No real reason to use vars on this snippet at all.
    also make use of tnick and mnick tnick is a temp nick an mnick is your main nick as well as $away , $awaymsg , and you can also use $awaytime.
    You may as well make use of mIRC's away Identifiers thats why they have them so you don't have to set unneeded vars an such.
    you could do something like this for example:
    Code (mirc):
    alias as {
      If (!$away) {
        tnick $+($me,[Away])
        .Away $$?="Enter your away message"
        echo -a I am currently away - Reason: $!
      }
      elseif ($away) {
        echo -a I am back - Away Reason: $awaymsg
        mnick $mnick
        .away
      }
    }
    just showing a different way to go about it nothing more...

    if you want to set ur away nick different every time then you can change this line
    Code (mirc):
     tnick $+($me,[Away])
    to this:
    Code (mirc):
    tnick $$?="Enter your away nick"
  4. Offline

    D3M0N Corporal

    Member Since:
    Jan 10, 2012
    Message Count:
    694
    Likes Received:
    63
    Trophy Points:
    103
    Medusa likes this.
  5. Offline

    Napa182 Moderator

    Member Since:
    Dec 18, 2011
    Message Count:
    222
    Likes Received:
    83
    Trophy Points:
    56
    Well it's not really a public away message as it echos to the channel instead of messaging it.
  6. Offline

    tomtiger11 Newbie

    Member Since:
    Jun 9, 2012
    Message Count:
    19
    Likes Received:
    7
    Trophy Points:
    3
    Looks... Interesting!

Share This Page