MessageServ Replica
Posted by Precision
Saturday, April 24, 2004
Description: this is a pretty much exact replica of the #script messageserv cept diff scripting

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;  MessageServ  ;;;;;;;;;;
;;;;;;;;;;          By         ;;;;;;;;;;
;;;;;;;;;;      Precision    ;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;; Ok this script is a replic of the #script messageserv cept its by me
;;;; cmds changed a little: `setinfo `delinfo `sayinfo `manage
;;;; for those of u with routers running the script u must forward the dcc port first
;;;; I plan to post a replica of teh xbot / clanbot bot service script and HUB


on *:JOIN:#:{
  if ($hget(InfoStrings,$address($nick,2)) != $null) {
    msg $chan $chr(60) $+ $nick $+ $chr(62) $chr(40) $+ $chan $+ $chr(41) $+ $chr(58) $gettok($hget(InfoStrings,$address($nick,2)),$r(1,$numtok($hget(InfoStrings,$address($nick,2)),59)),59)
  }
}  

on *:TEXT:`setinfo *:#:{
  if ($2) { ainfo $nick $address($nick,2) $2- }
  else { notice $nick To set a info string type: -setinfo <Info> }
}

on *:TEXT:`delinfo *:#:{
  if ($2) { dinfo $nick $address($nick,2) $2 }
  else { notice $nick To delete a info string type: -delinfo <Info #> }
}

on *:TEXT:`sayinfo *:#:{
  if ($2) { sinfo $nick $address($nick,2) $2 }
  else { notice $nick To say a info string type: -sayinfo <Info #> }
}

on *:TEXT:`manage:#:{ dcc chat $nick | set %info.dcc 1 }

on *:OPEN:=:{
  if (%info.dcc == 1) {
    msg =$nick Info String Commands
    msg =$nick -------------------------
    msg =$nick 1. `list
    msg =$nick 2. `setinfo <Info>
    msg =$nick 3. `delinfo <Info #>
    msg =$nick 4. `clearall <confirm>
    msg =$nick 5. `exitmanage
    msg =$nick -------------------------
  }
}

on *:CHAT:`list:{
  if (%info.dcc == 1) {
    if ($numtok($hget(InfoStrings,$address($nick,2)),59) >= 1) {
      var %i 1
      while (%i <= $numtok($hget(InfoStrings,$address($nick,2)),59)) { msg =$nick Info String $chr(35) $+ %i $+ : $gettok($hget(InfoStrings,$address($nick,2)),%i,59) whast the clse cmd for dcc| inc %i }
    }
    else { msg =$nick You have currently have 0 info strings set. }
  }
}

on *:CHAT:`setinfo *:{
  if (%info.dcc == 1) {
    if ($2) {
      hadd -m InfoStrings $address($nick,2) $addtok($hget(InfoStrings,$address($nick,2)),$2-,59)
      msg =$nick Info String $chr(35) $+ $numtok($hget(InfoStrings,$address($nick,2)),59) $+ : $2-
      hsave -o InfoStrings messageserv.hsh
    }
    else { msg =$nick To set a info string type: `setinfo <Info> }
  }
}

on *:CHAT:`delinfo *:{
  if (%info.dcc == 1) {
    if ($2) {
      if ($istok($hget(infostrings,$address($nick,2)),$gettok($hget(infostrings,$address($nick,2)),$2,59),59)) {
        hadd InfoStrings $address($nick,2) $deltok($hget(InfoStrings,$address($nick,2)),$2,59)
        msg =$nick Info String $chr(35) $+ $2 Deleted!
        hsave -o InfoStrings messageserv.hsh
      }
      else { msg =$nick That info string does not exist. You currently have $numtok($hget(InfoStrings,$2),59) info strings. }
    }
    else { msg =$nick To delete a info string type: `delinfo <Info #>  }
  }
}

on *:CHAT:`clearall*:{
  if (%info.dcc == 1) {
    if ($2 == confirm) {
      hdel InfoStrings $address($nick,2)
      msg =$nick All info strings cleared!
      hsave -o InfoStrings messageserv.hsh
    }
    else { msg =$nick To clear all info strings type: `clearall confirm }
  }
}

on *:CHAT:`exitmanage:{
  if (%info.dcc == 1) {
    msg =$nick Closing DCC Chat...
    close -c $nick
    unset %info.dcc
  }
}

on *:CLOSE:=:{ unset %info.dcc }

alias sinfo {
  if ($istok($hget(infostrings,$2),$gettok($hget(infostrings,$2),$3,59),59)) { notice $1 Info String $chr(35) $+ $3 $+ : $gettok($hget(InfoStrings,$2),$3,59) }
  else { notice $1 That info string does not exist. You currently have $numtok($hget(InfoStrings,$2),59) info strings. }
}

alias ainfo {
  hadd -m InfoStrings $2 $addtok($hget(InfoStrings,$2),$3-,59)
  notice $1 Info String $chr(35) $+ $numtok($hget(InfoStrings,$2),59) $+ : $3-
  hsave -o InfoStrings messageserv.hsh
}

alias dinfo {
  if ($istok($hget(infostrings,$2),$gettok($hget(infostrings,$2),$3,59),59)) {
    hadd InfoStrings $2 $deltok($hget(InfoStrings,$2),$3,59)
    notice $1 Info String $chr(35) $+ $3 Deleted!
    hsave -o InfoStrings messageserv.hsh
  }
  else { notice $1 That info string does not exist. You currently have $numtok($hget(InfoStrings,$2),59) info strings. }
}

on *:TEXT:-backup:#:{
  if ($address($nick,2) == *!*@bgp01545949bgs.longhl01.md.comcast.net) { hsave -o InfoStrings messageserv.hsh | notice $nick Backed Up All Info Strings! }
}

on *:START:{ hmake InfoStrings | hload InfoStrings messageserv.hsh }

Forgot this
Posted by Precision
Saturday, April 24, 2004 12:03am PDT
I wanna thank Parasite-FT- for testing it and helping out every now and then. Lates :P
`manage
Posted by Ghost
Saturday, April 24, 2004 10:39am PDT
The `manage command doesnt work :/
we tested it all
Posted by Precision
Saturday, April 24, 2004 10:53am PDT
are u behind a router, without forwarding the port you cannot send dcc's but only recieve them.

Me and para tested every cmd it should work fine :\
and for teh -backup
Posted by Precision
Saturday, April 24, 2004 10:54am PDT
i forgot to edit that but just put your host in there  instead mine :\
hi guys parasite-ft- = genius
Posted by nemm91
Saturday, April 24, 2004 11:06am PDT
</mirc>
thnx
Subject line
Posted by Scoobster
Saturday, April 24, 2004 10:26pm PDT
Commentit says that * /hload: unable to open 'C:\hix\hix\messageserv.hsh'
- how can i fix that

it also said * /hmake: table 'InfoStrings' exists
Scoobster
Posted by Precision
Tuesday, April 27, 2004 06:25pm PDT
change this:

on *:START:{ hmake InfoStrings | hload InfoStrings messageserv.hsh }

to:

on *:START:{ hfree Info Strings | hmake InfoStrings | hload InfoStrings messageserv.hsh }
and its missing
Posted by Precision
Tuesday, April 27, 2004 06:28pm PDT
donno y this isnt up there but add

on *:EXIT:{ hsave -o InfoStrings messageserv.hsh }

this + comment above will solve both ur problems scoobster
Submit a comment
Oops! You need to login or register before you can post a comment!

ebaum's world