Top

wMSG


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  0.0 (of 0 scores)
Date Added  Jul 26, 2009
Last Updated  Jul 26, 2009
Tags  message  mirc  script  welcome 

Introduction

A simple but effective Welcome message script.

Grab the Code

    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

  (3)  RSS
WorldDMT
Comments: 171
 
mIRC Snippet:  wMSG
Posted on Jul 26, 2009 4:19 am
ini file for $nick is not always a good idea

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

Code:
if ($readini(wmsg.ini, $nick, wmsg) == 1) {
can be
if $readini(wmsg.ini, $nick, wmsg) {

shadow-Majestic
Comments: 10
 
mIRC Snippet:  wMSG
Posted on Jul 26, 2009 4:25 am
if $readini(wmsg.ini, $nick, wmsg) {
checks for if it excists, if its 0, it excists
WorldDMT
Comments: 171
 
mIRC Snippet:  wMSG
Posted on Jul 26, 2009 5:07 am
in mIRC the condition if return 1 is $true if return 0 or $null is $false

like that e.g

Code:
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

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom