wMSG

By shadow-Majestic on Jul 26, 2009

A simple but effective Welcome message script.

    alias wmsg {
      if ($1 == $null) {
        echo -a  $timestamp <WMGS> Welcome msg help!
        echo -a  $timestamp <WMGS> wmsg add - add
        echo -a  $timestamp <WMGS> wmsg del - del
        echo -a  $timestamp <WMGS> wmsg cadd - chan add
        echo -a  $timestamp <WMGS> wmsg cdel - chan del
      }
      if ($1 == add) {
        writeini -n wmsg.ini $2 wmsg 1
        writeini -n wmsg.ini $2 msg $3-
        echo -a  $timestamp <WMGS> Welcome msg added!

      }
      if ($1 == cadd) {
        writeini -n wmsg.ini $2 wmsg 1
        writeini -n wmsg.ini $2 msg $3-
        echo -a  $timestamp <WMGS> Chan welcome msg added!
      }
      if ($1 == del) {
        if ($eradini(wmsg.ini, $2, wmsg) == 1) {
          writeini -n wmsg.ini $2 wmsg 0
          echo -a  $timestamp <WMGS> Welcome msg deleted!
          halt
        }
        echo -a $timestamp <WMGS> No such entry!
      }
      if ($1 == cdel) {
        if ($eradini(wmsg.ini, $2, wmsg) == 1) {
          writeini -n wmsg.ini $2 wmsg 0
          echo -a $timestamp <WMGS> Chan welcome msg deleted!
          halt
        }
        echo -a No such entry!
      }
    }
    on *:JOIN:*:{
      if ($readini(wmsg.ini, $nick, wmsg) == 1) {
        msg $chan 4*_Welcome_*13 -=15 $+ $nick $+ 13=- 8-- 14 $readini(wmsg.ini, $nick, msg)
      }
      if ($readini(wmsg.ini, $chan, wmsg) == 1) {
        msg $chan 4*_Welcome_*13 -=15 $+ $nick $+ 13=- 12-- 14 $readini(wmsg.ini, $chan, msg)
      }
    }

Comments

Sign in to comment.
WorldDMT   -  Jul 26, 2009

in mIRC the condition if return 1 is $true if return 0 or $null is $false

like that e.g

alias t {
  var %t $1
  if (%t) echo -a true
  else echo -a false
}

look for the result

/t 1 return true
/t 0 return false
/t return false

so if $readini(wmsg.ini, $nick, wmsg) if return 1 command will be execute if return 0 or $null will not execute

 Respond  
shadow-Majestic   -  Jul 26, 2009

if $readini(wmsg.ini, $nick, wmsg) {
checks for if it excists, if its 0, it excists

 Respond  
WorldDMT   -  Jul 26, 2009

ini file for $nick is not always a good idea

and u use 1 and 0 so u dont need to put "== 1"

if ($readini(wmsg.ini, $nick, wmsg) == 1) {
can be
if $readini(wmsg.ini, $nick, wmsg) {
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.