Guestbook

By ShAmPi on Apr 02, 2008

Well this is what the title says it is :)
Just a simple guestbook script for use in mIRC.

!guestbook shows the commands
!writegb leaves a message in the guestbook
!viewgb shows the entries.

Have fun with it.
Open up remotes (alt+r) and paste this script in it.

on *:TEXT:!guestbook:#: {
  .timer1 1 1 notice $nick Guestbook v1.2 by ShAmPi
  .timer2 1 2 notice $nick 12-----------------------------------------------------------
  .timer3 1 3 notice $nick 7With this you can leave a message into the guestbook
  .timer4 1 4 notice $nick 7Do NOT abuse this script!
  .timer5 1 5 notice $nick 7The triggers should be typed in the channel the bot is in.
  .timer6 1 6 notice $nick 7The triggers are shown below. Have fun
  .timer7 1 7 notice $nick 12-----------------------------------------------------------
  .timer8 1 8 notice $nick 7The commands are:
  .timer9 1 9 notice $nick 4!writegb <message> - To leave a message in the guestbook
  .timer10 1 9 notice $nick 4!viewgb - to view the guestbook messages
  .timer11 1 11 notice $nick 12-----------------------------------------------------------
}

on *:text:!viewgb:#:{
  set %guestbook.c 1
  /filter -c " $+ $mircdirguest.txt $+ " c:\lines.txt * $+ *
  set %guestbook.total $filtered
  while (%guestbook.c <= %guestbook.total) {
    set %guestbook.msg $read($mircdirguest.txt, %guestbook.c)
    set %gb.nick $gettok(%guestbook.msg,2,32)
    set %gb.time $gettok(%guestbook.msg,1,32)
    set %gb.hour $asctime(%gb.time , HH:nn:ss)
    set %gb.date $asctime(%gb.time , dd/mm/yyyy)
    set %gb.msg $gettok(%guestbook.msg,3-,32)
    .timermsgguestbooknick $+ %guestbook.c $+ $nick 1 $calc( %guestbook.c * 2) .msg $nick 7[ $+ %gb.nick $+ 7]-[ $+ %gb.hour %gb.date $+ ]-7[ $+ %gb.msg $+ 7]
    inc %guestbook.c
  }
}

on *:text:!writegb*:#:{
  if ($2- != $null) {
    /write -a " $+ $mircdirguest.txt $+ " $ctime $nick $2-
    .notice $nick Your message ( $+ $2- $+ )
    .notice $nick is succesfully submitted into the list!
  }
  else {
    .notice $nick Please Fill in Your Message!
  }
}

Comments

Sign in to comment.
PuNkTuReD   -  Apr 08, 2009

@linhvan2k, why dont you just copy paste?

 Respond  
linhvan2k   -  Apr 08, 2009

hi , can u send me code of guestbook basic ?
My email : vanlinh2k@gmail.com
thanks !

 Respond  
Jonesy44   -  Apr 02, 2008

oooooh, prepare for some serious lag on that while loop !

Eeeeek, i remember an old bot i ran had a .txt on a while loop for a help file, on a VERY powerful server, lagged it like hell xD

 Respond  
xDaeMoN   -  Apr 02, 2008
  1. You could have just used $lines(file.txt) to get the number of lines for your file.
  2. Use /var instead of /set, making them local variables (or just get rid of the variables, which is not really necessary ;) )
  3. Optional: You can also use /play to make use of it\'s flood protection, then use an alias so you can manipulate the output.
 Respond  
BlueThen   -  Apr 02, 2008

I don\'t really like timed messages. Mostly because I have to wait to get what I commanded for.

 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.