S.A.Global Messaging System v.2.0.1.0

By Tamaki on Jul 08, 2009

This is the standalone global messaging system. Friendly for all users, b/c YOU DO NOT NEED TAD's INTEGRATION SCRIPT for this to work. You do need the new AGFile system to make this work though. You can find it here: http://www.hawkee.com/snippet/8236/

I would still like the time to explain some new things.

When you load this script, you may or may not be asked to run initialization. Make sure you click yes. If you do not, type /gms register

Ttype /gms to open the pop-up. If you're not /oper-ed up yet, there is an option to do that in the menu. Another option (that wasn't in the non-s.a. version of the script) is the ability to save Globals!!!! Yes, you too can save globals here. Just click on SAVED GLOBALS in the option menu. Type what you want in the top edit box and click save. Then to use a saved global, select it from the list, and click USE, or you can delete it if you don't want it anymore.

Any-who...hope you enjoy! If you want, leave feedback or contact me on my irc at /server -m irc.authoritygamer.com -j #authoritygamer


v.1.0.0.0 - Initial Release
v.1.0.1.0 - Fixed the problem where if you didn't check any boxes on the /gid pop-up, it would give an error for a bad Elseif
v.2.0.0.0 - Renovated to be faster and more efficient. Now available on the new AGFile system.
v.2.0.1.0 - Fixed return errors in the GMS Identifier section at the top of the snippet.

Current Version: 2.0.1.0

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;The_Almighty_Duelist's Scripts;;;;;;;
;;;;;Standalone Global Messaging Service;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;Loading and Starting;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

alias gmsperm {
  If ($1 == version) { return 2.0.1.0 }
  If ($1 == title) { return Standalone_Global_Messaging_Service }
  If ($1 == author) { return The_Almighty_Duelist }
  If ($1 == description) { return Standalone Global Messaging Service for IRCops }
  If ($1 == product_id) { return N002-2010 }
  If ($1 == updateroot) { return www.hawkee.com }
  If ($1 == updatepath) { return /snippet/6391/ }
}

on *:LOAD: {
  echo -a Standalone Global Messaging Service (C) $+ $asctime(yyyy) DJ Bill Enterprizes
  If ($Readini(agfile.ini,gms,installed) != yes) {
    agfile register gms $gmsperm(version) $gmsperm(title) $gmsperm(author) yes $gmsperm(updateroot) $gmsperm(updatepath) $gmsperm(description)
    echo -a Please type /install gms to install the Standalone Global Messaging Service
  }
  Else {
    If ($agversion(gms) != $gmsperm(version)) {
      agfile update gms $gmsperm(version) $gmsperm(title) $gmsperm(product_id)$gmsperm(author) yes $gmsperm(updateroot) $gmsperm(updatepath) $gmsperm(description)
      exit -nr
    }
  }
}

on *:START: {
  echo -a Standalone Global Messaging Service (C) $+ $asctime(yyyy) DJ Bill Enterprizes
  If ($Readini(agfile.ini,gms,installed) != yes) {
    agfile register gms $gmsperm(version) $gmsperm(title) $gmsperm(author) yes $gmsperm(updateroot) $gmsperm(updatepath) $gmsperm(description)
    echo -a Please type /install gms to install the Standalone Global Messaging Service
  }
  Else {
    If ($agversion(gms) != $gmsperm(version)) {
      agfile update gms $gmsperm(version) $gmsperm(title) $gmsperm(product_id)$gmsperm(author) yes $gmsperm(updateroot) $gmsperm(updatepath) $gmsperm(description)
      exit -nr
    }
    If ($readini(gms.ini,settings,auto_start) == yes) { dialog -md gms gms }
  }
}

;;;;;;;;;;;;;;;;;
;;;;;Aliases;;;;;
;;;;;;;;;;;;;;;;;

alias gms {
  If ($1 == register) {
    agfile register gms $gmsperm(version) $gmsperm(title) $gmsperm(author) yes $gmsperm(updateroot) $gmsperm(updatepath) $gmsperm(description)
    echo -a Standalone Global Messaging Service is now registered, you can type /install gms now.
  }
  If ($1 == install) {
    writeini gms.ini settings auto_start yes
    writeini gms.ini settings nick on
    writeini gms.ini settings date on
    agfile install gms $gmsperm(product_id)
    writeini agfile.ini status installing no
  }
  If ($1 == update) {
    agfile update gms $gmsperm(version) $gmsperm(title) $gmsperm(product_id) $gmsperm(author) yes $gmsperm(updateroot) $gmsperm(updatepath) $gmsperm(description)
    writeini agfile.ini status updating no
  }
  If ($1 == uninstall) {
    .remove gms.ini
    .remove gms.txt
    agfile uninstall gms
    echo -a Standalone Global Messaging Service has been uninstalled!
  }
  If (!$1) {
    dialog $iif($dialog(gms) == gms,-v,-m gms) gms
  }
}

alias f12 {
  If ($readini(agfile.ini,gms,installed) != yes) { echo -a Please type /install gms first! | halt }
  dialog $iif($dialog(gms) == gms,-v,-m gms) gms
}

alias updaterecentglobals {
  did -r recglo 3
  var %temp.1 1
  While (%temp.1 <= $lines(gms.txt)) {
    did -a recglo 3 $read(gms.txt, %temp.1)
    inc %temp.1
  }
}

;;;;;;;;;;;;;;;;;
;;;;;Dialogs;;;;;
;;;;;;;;;;;;;;;;;

dialog gms {
  title Global Messaging
  option dbu
  size -1 -1 101 44
  menu "Manage", 1
  item "Oper", 2
  item "Exit", 3
  item break, 4
  item "Saved Globals", 5
  edit "", 6, 1 1 100 10, autohs
  check "Global Nick", 7, 1 11 100 10
  check "Global Date/Time", 8, 1 22 100 10
  button "Send Notice", 9, 1 33 100 10, disable
}

dialog oper {
  title Oper Info
  option dbu
  size -1 -1 101 44
  edit "Username", 1, 1 1 100 10, autohs default
  edit "Password", 2, 1 11 100 10, autohs pass
  button "Login?", 3, 1 22 100 10
  button "Main Menu", 4, 1 33 100 10
}

dialog recglo {
  title Recent Globals
  option dbu
  size -1 -1 101 100
  edit "", 1, 1 1 100 10, autohs
  button "Save", 2, 1 11 100 10
  list 3, 1 22 100 50
  button "Delete", 4, 1 78 100 10
  button "Use", 5, 1 89 100 10
  menu "Options", 6
  item "Back", 7
}

;;;;;;;;;;;;;;;;;;
;;;;;Triggers;;;;;
;;;;;;;;;;;;;;;;;;

on *:DIALOG:*:*:*: {
  If ($dname == gms) {
    If ($devent == init) {
      If ($readini(gms.ini,settings,nick) == on) { did -c $dname 7 }
      If ($readini(gms.ini,settings,date) == on) { did -c $dname 8 }
    }
    If ($devent == menu) {
      If ($did == 2) {
        dialog -x $dname
        dialog $iif($dialog(oper) == oper,-v,-md oper) oper
      }
      If ($did == 3) { dialog -x $dname }
      If ($did == 5) {
        dialog -x $dname
        dialog $iif($dialog(recglo) == recglo,-v,-md recglo) recglo
      }
    }
    If ($devent == edit) {
      If ($did == 6) { did -e $dname 9 }
    }
    If ($devent == sclick) {
      If ($did == 7) { writeini gms.ini settings nick $iif($readini(gms.ini,settings,nick) == on,off,on) | did $iif($readini(gms.ini,settings,nick) == on,-c,-u) $dname 7 }
      If ($did == 8) { writeini gms.ini settings date $iif($readini(gms.ini,settings,date) == on,off,on) | did $iif($readini(gms.ini,settings,date) == on,-c,-u) $dname 8 }
      If ($did == 9) {
        If (!$did(6)) { did -f $dname 6 | did -b $dname 9 | halt }
        write -c temp.txt .msg OperServ global $iif($readini(gms.ini,settings,nick) == on,From: $me,) $iif($readini(gms.ini,settings,date) == on,Date: $asctime(ddmmmyyyy) Time: $asctime(hh:nn:ss TT),) Message: $did(6)
        $read(temp.txt,1)
        .remove temp.txt
        did -rf $dname 6
        did -b $dname 9
      }
    }
  }
  If ($dname == oper) {
    If ($devent == sclick) {
      If ($did == 3) {
        If (!$did(1)) { did -f $dname 1 | halt }
        If (!$did(2)) { did -f $dname 2 | halt }
        oper $did(1) $did(2)
        dialog -x $dname
        dialog $iif($dialog(gms) == gms,-v,-md gms) gms
      }
      If ($did == 4) {
        dialog -x $dname
        dialog $iif($dialog(gms) == gms,-v,-md gms) gms
      }
    }
  }
  If ($dname == recglo) {
    If ($devent == init) { updaterecentglobals }
    If ($devent == sclick) {
      If ($did == 2) {
        If (!$did(1)) { echo -a Please type a message into the box to save it. | halt }
        write gms.txt $did(1)
        did -rf $dname 1
        echo -a Message Saved!
        updaterecentglobals
      }
      If ($did == 3) { echo -a Example: $iif($readini(gms.ini,settings,nick) == on,From: $me,) $iif($readini(gms.ini,settings,date) == on,Date: $asctime(ddmmmyyyy) Time: $asctime(hh:nn:ss TT),) Message: $did(3).seltext }
      If ($did == 4) {
        write -dl $+ $did(3).sel gms.txt
        echo -a Message Deleted!
        updaterecentglobals
      }
      If ($did == 5) {
        If (!$did(3).seltext) { echo -a Please select a message to use first! | halt }
        dialog $iif($dialog(gms) == gms,-v,-md gms) gms
        did -ra gms 6 $did(3).seltext
        did -e gms 9
        dialog -x $dname
      }
    }
    If ($devent == menu) {
      If ($did = 7) {
        dialog -x $dname
        dialog $iif($dialog(gms) == gms,-v,-md gms) gms
      }
    }
  }
}

Comments

Sign in to comment.
Tamaki   -  Apr 18, 2011

I took a look at this script and I freaked out for a sec thinking...did i actually use to code this way? I FIXED IT THOUGH! :D

Anyway, this script is now ready for the new AGFile which can be downloaded here: http://www.hawkee.com/snippet/8236/

 Respond  
Tamaki   -  Aug 22, 2010

Fixed the problem where when you tried to global something without sending your nick or the date and time, it would return an /elseif error.

 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.