LG-Gaming Marathon
Would you like to react to this message? Create an account in a few clicks or log in to continue.


LG-Gaming Marathon Server hosted by LGrobert
 
HomeSearchLatest imagesRegisterLog in

 

 Guestbook

Go down 
AuthorMessage
LGrobert
Elite Newbie
LGrobert


Male Number of posts : 40
Age : 37
Status : Founder
Points : 9
Registration date : 2008-09-30

Guestbook Empty
PostSubject: Guestbook   Guestbook Icon_minitimeFri Nov 21, 2008 1:37 pm

That is a Guestbook script:

Code:
;check for start.mrc to be loaded for stability
on 1:LOAD: {
  if ($script(start.mrc) == $null) { .load -rs scripts\start.mrc | /echo 4!!!!> Warning: A vital file has not been loaded, please restart the bot (press F9) to load this file. }
}
;begin scripting
;channel commands scripting
on 1000:text:*gbook*:#: {
  if ($1 == %c $+ gbook) {
    if ($2 == on) { set %gbnum $ini(ini\gb.ini,0) | .enable #gbcode | .msg $chan 5The Guestbook Has Just Been Enabled, To Leave A Message Type %c $+ guestbook. | set %last.used.command gbook on | set %last.person $nick | set %st.gb on | halt }
    if ($2 == off) { .disable #gbcode | set %gbnext off | unset %gbvnum | .msg $chan 5The Guestbook Has Just Been Disabled. | set %last.used.command gbook off | set %last.person $nick | set %st.gb off | halt }
    else { .notice $nick 5Incorrect command usage: %c $+ gbook <on/off> | halt }
  }
  else { halt }
}
on 1500:text:*gbclear*:#: {
  if ($1 == %c $+ gbclear) { /write -c ini\gb.ini | unset %gb* | .msg $nick 5All messages in the Guestbook have been cleared. | set %last.used.command gbclear | set %last.person $nick }
  else { halt }
}
;query operator scripting
on 1500:text:*gbclear*:*: {
  if ($1 == %qc $+ gbclear) { /write -c ini\gb.ini | unset %gb* | .msg $nick 5All messages in the Guestbook have been cleared. | closemsg $nick | set %last.used.command gbclear | set %last.person $nick }
  else { halt }
}
on 1500:TEXT:*gbdel*:*: {
  if ($1 == %qc $+ gbdel) {
    if ($2 == $null) { .msg $nick 4Incorrect command usage: .gbdel <entry number> | closemsg $nick | halt }
    if ($readini(ini\gb.ini, $2, name) == $null) { .msg $nick 5That entry does not exist. | closemsg $nick | halt }
    else { writeini ini\gb.ini $2 name you_better_not_have_this_nick | writeini ini\gb.ini $2 date you_better_not_have_this_nick | writeini ini\gb.ini $2 place you_better_not_have_this_nick | writeini ini\gb.ini $2 msg you_better_not_have_this_nick | .msg $nick 5Entry $2 has successfully been deleted. | closemsg $nick | halt }
  }
  else { halt }
}
;events scripting
#gbcode off
on 1:text:*guestbook*:#: {
  if ($1 == %c $+ guestbook) {
    .msg $nick 10Below are the commands for the Guestbook.10 [Please type in this window]
    .msg $nick 7.gbadd7 14Let's you add an entry to the Guestbook.14
    .msg $nick 7.gbgo <entry>7 14Let's you view a specific entry.14
    .msg $nick 7.gbsearch <search string>7 14Let's you search all entries.14
    .msg $nick 7.gbview7 14Let's you view all entries.14
  }
  else { halt }
}
on 1500:text:*guestbook*:#: {
  if ($1 == %c $+ guestbook) {
    .msg $nick 10Below are the commands for the Guestbook.10 [Please type in this window]
    .msg $nick 7.gbadd7 14Let's you add an entry to the Guestbook.14
    .msg $nick 7.gbgo <entry number>7 14Let's you view a specific entry.14
    .msg $nick 7.gbsearch <search string>7 14Let's you search all entries.14
    .msg $nick 7.gbview7 14Let's you view all entries.14
    .msg $nick 7.gbclear7 14Let's you clear all guestbook entries.14
    .msg $nick 7.gbdel <entry number>7 14Let's you delete a specific entry.14
  }
  else { halt }
}
;gbgo scripting
on 1:TEXT:*gbgo*:*: {
  if ($1 == %qc $+ gbgo) {
    if ($2 == $null) { .msg $nick 4Incorrect command usage: .gbgo <entry number> | .msg $nick 4Such as .gbgo 4. | closemsg $nick | halt }
    if ($readini(ini\gb.ini, $2, name) == $null) { .msg $nick 5That entry does not exist. | closemsg $nick | halt }
    if ($readini(ini\gb.ini, $2, name) == you_better_not_have_this_nick) { .msg $nick 5That entry has been deleted. | closemsg $nick | halt }
    else { .msg $nick ------------Entry $2 $+ ------------ | .msg $nick ( $+ $readini(ini\gb.ini, $2, date) $+ ): $readini(ini\gb.ini, $2, name) | .msg $nick 10Origin1: $readini(ini\gb.ini, $2, place) | .msg $nick 10Message1: $readini(ini\gb.ini, $2, msg) | .msg $nick --------Entry Finished--------- | closemsg $nick | halt }
  }
  else { halt }
}
on 1:TEXT:*gbsearch*:*: {
  if ($1 == %qc $+ gbsearch) {
    if ($2 == $null) { .msg $nick 4Incorrect command usage: .gbsearch <search string> | .msg $nick 4Such as .gbsearch great bot. | closemsg $nick | halt }
    if (%gbnum == $null) { .msg $nick 5No entries exist to search. | closemsg $nick | halt }
    set %gbsearch 1
    :GBSEARCH
    if (%gbsearch <= %gbnum) {
      if ($readini(ini\gb.ini, %gbsearch, name) == you_better_not_have_this_nick) { .inc %gbsearch 1 | goto GBSEARCH }
      if ($2- isin $readini(ini\gb.ini, %gbsearch, name)) { .msg $nick ------------Entry %gbsearch $+ ------------ | .msg $nick ( $+ $readini(ini\gb.ini, %gbsearch, date) $+ ): $readini(ini\gb.ini, %gbsearch, name) | .msg $nick 10Origin1: $readini(ini\gb.ini, %gbsearch, place) | .msg $nick 10Message1: $readini(ini\gb.ini, %gbsearch, msg) | .msg $nick --------Entry Finished--------- | closemsg $nick | halt }
      if ($2- isin $readini(ini\gb.ini, %gbsearch, place)) { .msg $nick ------------Entry %gbsearch $+ ------------ | .msg $nick ( $+ $readini(ini\gb.ini, %gbsearch, date) $+ ): $readini(ini\gb.ini, %gbsearch, name) | .msg $nick 10Origin1: $readini(ini\gb.ini, %gbsearch, place) | .msg $nick 10Message1: $readini(ini\gb.ini, %gbsearch, msg) | .msg $nick --------Entry Finished--------- | closemsg $nick | halt }
      if ($2- isin $readini(ini\gb.ini, %gbsearch, msg)) { .msg $nick ------------Entry %gbsearch $+ ------------ | .msg $nick ( $+ $readini(ini\gb.ini, %gbsearch, date) $+ ): $readini(ini\gb.ini, %gbsearch, name) | .msg $nick 10Origin1: $readini(ini\gb.ini, %gbsearch, place) | .msg $nick 10Message1: $readini(ini\gb.ini, %gbsearch, msg) | .msg $nick --------Entry Finished--------- | closemsg $nick | halt }
      else { .inc %gbsearch 1 | goto GBSEARCH }
    }
    else { .msg $nick 5No entry was found containing: $2- $+ . | closemsg $nick | halt }
  }
  else { halt }
}

alias nextCheck {
  if (%gbvnum == %gbnum) { .msg $nick 4There are no more messages to view. | set %gbnext off }
  else if (%gbvnum < %gbnum) { set %gbnext on | .msg $nick 4To view message %gbvnum of %gbnum $+ , please type .gbnext. }
}

on 1:TEXT:*gbview*:*: {
  if ($1 == %qc $+ gbview) {
    :NOWWORKS
    if ((%gbInUse == $null) || (%gbInUse == false)) {
      set %gbInUse true
      .timer567 1 120 /set %gbInUse false
      .timer568 1 120 /msg $nick 4Your time to use the .gbview command has expired. If you wish to view the guestbook starting at the first entry, please type .gbview again.
      if ((%gbnum == $null) || (%gbnum == 0)) { .msg $nick 5There are currently no entries to view. | closemsg $nick | halt }
      else if (%gbnum > 0) {
        set %gbvnum 1
        if ($readini(ini\gb.ini, %gbvnum, name) == you_better_not_have_this_nick) { .msg $nick 5Entry %gbvnum has been deleted. | nextCheck | closemsg $nick | halt }
        else { .msg $nick ------------Entry %gbvnum $+ ------------ | .msg $nick ( $+ $readini(ini\gb.ini, %gbvnum, date) $+ ): $readini(ini\gb.ini, %gbvnum, name) | .msg $nick 10Origin1: $readini(ini\gb.ini, %gbvnum, place) | .msg $nick 10Message1: $readini(ini\gb.ini, %gbvnum, msg) | .msg $nick --------Entry Finished--------- | nextCheck | closemsg $nick | halt }
      }
    }
    else {
      if (%gbvnum == %gbnum) { set %gbInUse false | .timer567 off | .timer568 off | goto NOWWORKS }
      else { .msg $nick 5The guestbook is being viewed by someone else. Please try again in 2 minutes. | halt }
    }
  } 
}

on 1:TEXT:*gbnext*:*: {
  if ($1 == %qc $+ gbnext) {
    if (%gbnext == on) {
      inc %gbvnum
      if ($readini(ini\gb.ini, %gbvnum, name) == you_better_not_have_this_nick) { .msg $nick 5Entry %gbvnum has been deleted. | nextCheck | closemsg $nick | halt }
      else { .msg $nick ------------Entry %gbvnum $+ ------------ | .msg $nick ( $+ $readini(ini\gb.ini, %gbvnum, date) $+ ): $readini(ini\gb.ini, %gbvnum, name) | .msg $nick 10Origin1: $readini(ini\gb.ini, %gbvnum, place) | .msg $nick 10Message1: $readini(ini\gb.ini, %gbvnum, msg) | .msg $nick --------Entry Finished--------- | nextCheck | closemsg $nick | halt }
    }
    else { halt }
  }
}

on 1:text:*gbadd*:*: {
  if ($1 == %qc $+ gbadd) { .msg $nick 5Please leave your name, to leave your name type: %qc $+ gbname <name here>. | closemsg $nick }
  else { halt }
}
on 1:text:*gbname*:*: {
  if ($1 == %qc $+ gbname) { writeini ini\tempgb.ini $nick name $2- | .msg $nick 5Please tell us where you are from, please type: %qc $+ gbplace <place of origin goes here> | closemsg $nick }
  else { halt }
}
on 1:text:*gbplace*:*: {
  if ($1 == %qc $+ gbplace) { writeini ini\tempgb.ini $nick place $2-  | .msg $nick 5Please leave a personal message, please type: %qc $+ gbmessage <message goes here> | closemsg $nick | halt }
  else { halt }
}
on 1:text:*gbmessage*:*: {
  if ($1 == %qc $+ gbmessage) { .inc %gbnum 1 | .writeini ini\gb.ini $calc(%gbnum) date $adate | writeini ini\gb.ini $calc(%gbnum) name [ $readini(ini\tempgb.ini, $nick, name) ] | .writeini ini\gb.ini $calc(%gbnum) place [ $readini(ini\tempgb.ini, $nick, place) ] | .writeini ini\gb.ini $calc(%gbnum) msg $2- |  .msg $nick 5Your entry has been saved. Please type .gbview to view all entries. | closemsg $nick }
  else { halt }
}
#gbcode end
Back to top Go down
http://lg-gaming.com
 
Guestbook
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
LG-Gaming Marathon :: Server :: Scripts-
Jump to: