Memo Script

By sharpknife on Jun 11, 2007

Ok.. I was looking for a way to make a memo system similar to MemoServ. Since I didnt find any.. I decided to make my own =).

To send a memo: !send
You can send a memo privately if you query the bot.

If the recipient is online, the bot will notice them saying "You have a new message!" Otherwise, the bot will notice the person when they join.

on *:TEXT:!send*:*: {
  /writeini memos.ini $2 sender $nick
  /writeini memos.ini $2 receiver $2 
  /writeini memos.ini $2 sender $nick
  /writeini memos.ini $2 msg $3-
  /writeini memos.ini $2 time $date(ddd) $date(mmmm) $date(dd) at $time(hh:nn TT) 
  notice $nick Memo has been sent to $2 $+ .
  notice $2 You have a new memo! Type !read to view it.
}

on *:JOIN:#:{
  if ($readini(memos.ini,$nick,receiver) = $nick) {
    notice $nick You have a memo from $readini(memos.ini,memo,sender) Type !read to view it!
  }
}

on *:TEXT:!read:*: {
  if ($readini(memos.ini,$nick,receiver) = $nick) {
    notice $nick Memo from $readini(memos.ini,$nick,sender) on $readini(memos.ini,$nick,time)
    notice $nick ------------------------------------------------------------------------
    notice $nick $readini(memos.ini,$nick,msg)
    notice $nick ------------------------------------------------------------------------
    notice $nick This Memo will be deleted in five seconds.
    /timer 1 5 /remini memos.ini $nick 
  }
  else notice $nick You dont have any memos at the moment!
}

Comments

Sign in to comment.
v9xx   -  Jun 04, 2010

THIS IS GREAT!!!
Love it thanks so much helps me with alot of stuff and example on how to read and write ini's THANKS!!!

 Respond  
tra_orex   -  Sep 10, 2009
on *:TEXT:!send*:*: {
  ;________________________________________________________________________________edit of original by sharpknife (hawkee.com)
  ;/writeini memos.ini $2 sender $nick
  .writeini memos.ini $2 receiver $2 
  .writeini memos.ini $2 sender $nick
  var %nick $nick
  .write $($+($2,.memo)) ( $+ $date(ddd) $date(mmmm) $date(dd) at $time(hh:nn TT) $+ ) %nick $+ : $3-
  set %nickvar %nick
  ;/writeini memos.ini $2 time $date(ddd) $date(mmmm) $date(dd) at $time(hh:nn TT)
  ;var %qwe $readini(memos.ini,$2,num)
  ;if (!%qwe) /writeini memos.ini $2 num 1
  ;if (%qwe) /writeini memos.ini $2 num $calc(%qwe + 1)
  .notice $nick Memo has been sent to $2 $+ .
  .notice $2 You have a new memo from $nick $+ ! Type !read to view it.
}

on *:JOIN:#:{
  if ($readini(memos.ini,$nick,receiver) = $nick) {
    .notice $nick You have $lines($($+($nick,.memo)) $+ ) memo(s). Type !read to view it!
  }
}

on *:TEXT:!read:*: {
  var %ert $lines($($+($nick,.memo)))
  if ($eval(%ert,4)) {
    ;msg # if works
    var %wer 1
    ;var %ert $readini(memos.ini,$2,num)
    while (%wer <= %ert) { 
      ;msg # while works
      .timer 1 $eval($calc(%wer*2),3) .msg $nick $read($eval($+($nick,.memo),4),%wer)
      .inc %wer 1
    }
    ;notice $nick Memo from $readini(memos.ini,$nick,sender) on $readini(memos.ini,$nick,time)
    ;notice $nick ------------------------------------------------------------------------
    ;notice $nick $readini(memos.ini,$nick,msg)
    ;notice $nick ------------------------------------------------------------------------
    ;notice $nick This Memo will be deleted in five seconds.
  }
  .remini memos.ini $nick 
  .remove $($+($nick,.memo))
  else msg $nick You dont have any memos at the moment!
}

i made an edit of it at the bequest of a friend....thought i might share....pbb gonna change the time too since differing time zones but meh....for another day....its so long cus i didn't delete any lines as i was editing, lol.....now it holds more than one memo and tells u how many

 Respond  
Mudkipz   -  Sep 08, 2008

Nice and simple tbh, It could also be alot shorter and simpler if you used Dynamic variables, Cant try atm, Will later ^.^ i read it and it looks okay

 Respond  
sharpknife   -  Jul 17, 2007

yeah my friend and i both worked on this.. he likes the /\'s but i usually dont use them.

 Respond  
|MELIORITE|   -  Jun 14, 2007

they are no longer necessary is all... helps to make a tidy style :)

 Respond  
kerstt   -  Jun 13, 2007

so now u made a triple post :P
but /\'s are just a matter of coding style, i dont really see the point if u would remove it, but hey thats your call.

 Respond  
|MELIORITE|   -  Jun 11, 2007

dang sry about dbl post .... first one lagged badly

 Respond  
|MELIORITE|   -  Jun 11, 2007

Your snippet is prettier than your pic ... heehee.... You could tidy up a little (for example remove the unnecessary /\'s before each \"write\") Otherwise pretty ok stuff

 Respond  
|MELIORITE|   -  Jun 11, 2007

Your snippet is prettier than your picture heehee... You could clean up the snippet a little (for example take out unnecessary / \'s before each write). Otherwise... pretty ok stuff

 Respond  
xDaeMoN   -  Jun 11, 2007

It is. =)

 Respond  
sharpknife   -  Jun 11, 2007

oh.. I searched for some before and didn\'t find any.. and I guess it\'s good for practice to write my own lol

 Respond  
xDaeMoN   -  Jun 11, 2007

There\'s a lot of memoserv-like scripts out there. Couple of them are my Simple Memoserv and xMemoserv v2. You can also use them for reference if you want to improve your script.

 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.