#memogroup on
on 1:text:!m*:%memo.chans:{
if (($1 == !memo) || ($1 = !m)) {
memor $nick $2-
}
}
on 1:text:!m*:?:{
if ($nick ison %memo.chans) {
if (($1 == !memo) || ($1 = !m)) {
memor $nick $2-
}
}
else {
msg $nick Hell no, you're not in any of my channels.
}
}
on *:nick:{
if ($chan isin %memo.chans) {
var %while = 2
while (%while <= $lines(memo.ini)) {
var %read = $read(memo.ini, %while)
var %r2 = $gettok(%read, 2-, 61)
var %from = $gettok(%r2, 1, 32)
var %nick = $gettok(%r2, 2, 32)
var %msg = $gettok(%r2, 3-, 32)
if (%nick == $nick) {
msg $nick Memo sent by %from $+ $chr(58)
var %x = $numtok(%msg,124)
var %y = 1
while (%y <= %x) {
msg $nick $gettok(%msg,%y,124)
inc %y
}
write -dl $+ $readn memo.ini
}
inc %while
}
}
}
on *:join:%memo.chans:{
var %while = 2
while (%while <= $lines(memo.ini)) {
var %read = $read(memo.ini, %while)
var %r2 = $gettok(%read, 2-, 61)
var %from = $gettok(%r2, 1, 32)
var %nick = $gettok(%r2, 2, 32)
var %msg = $gettok(%r2, 3-, 32)
if (%nick == $nick) {
msg $nick Memo sent by %from $+ $chr(58)
var %x = $numtok(%msg,124)
var %y = 1
while (%y <= %x) {
msg $nick $gettok(%msg,%y,124)
inc %y
}
write -dl $+ $readn memo.ini
}
inc %while
}
}
#memogroup end
menu status,channel,query {
MemoService
.Add a channel to list:/memo +c $?="Which channel?"
.Remove a channel from list:/memo -c $?="Which channel?"
.Enable service:/memo -e
.Disable service:/memo -d
}
on 1:load:{
echo -a You've just loaded the memo-script made by Trasp.
echo -a To add a channel to the list use the command: /memo +c #channel
echo -a If you want to know what you can do with this script you can use the help-command: /memo -h
set %memo.id 0
}
alias memo {
if ($1 == +c) {
if ($2 == $null) {
echo -a Please specify a channel to add.
halt
}
if ($left($2,1) != $chr(35)) {
var %chan = $chr(35) $+ $2
}
else {
var %chan = $2
}
var %chant = $findtok(%memo.chans, %chan, 44)
if (%chant != $null) {
echo -a Channel allready in list.
halt
}
if (%memo.chans == $null) {
set %memo.chans $2
}
else {
set %memo.chans %memo.chans $+ , $+ $2
}
echo -a %chan was added to the list of channels.
echo -a Current list: %memo.chans
halt
}
elseif ($1 == -c) {
if ($2 == $null) {
echo -a Please specify a channel to remove.
halt
}
if ($left($2,1) != $chr(35)) {
var %chan = $chr(35) $+ $2
}
else {
var %chan = $2
}
var %chtok = $findtok(%memo.chans, %chan, 44)
if (%chtok != $null) {
set %memo.chans $deltok(%memo.chans, %chtok, 44)
echo -a %chan was removed from the list of channels.
echo -a Current list: %memo.chans
}
else {
echo -a That channel does not exist.
halt
}
halt
}
elseif ($1 == -e) {
enable #memgroup
}
elseif ($1 == -d) {
disable #memgroup
}
elseif ($1 == -h) {
echo -a [In client]
echo -a Usage..........: /memo [-N] [#Channel]
echo -a ----------------
echo -a Add channel....: +c [#Channel]
echo -a Remove channel.: -c [#Channel]
echo -a Enable service.: -e
echo -a Disable service: -d
echo -a ----------------
echo -a -[In channel]-
echo -a Usage..........: !memo [-N] [ID] [Nick] [Memotext]
echo -a ----------------
echo -a List...........: -L
echo -a Help...........: -H
echo -a Send...........: -A
echo -a Delete.........: -D [ID]
echo -a ----------------
echo -a Example: !memo -a Trasp Where did you go last night?
echo -a This will send Trasp the message "Where did you go last night?" when he joins the next time.
echo -a -
echo -a Example: !memo -d 41831
echo -a This will delete the memo with ID 41831. If you don't enter the ID all memos sent by you will be deleted.
echo -a -
echo -a You can send more then one line, seperate them with the character: $chr(124)
echo -a Do not mix the options. You could also use !m instead of !memo.
halt
}
}
alias memor {
var %n = $1
if ($2 == -H) {
goto memo_help
}
elseif ($2 == -L) {
var %sent = $false
var %while = 2
while (%while <= $lines(memo.ini)) {
var %read = $read(memo.ini, %while)
var %r2 = $gettok(%read, 2-, 61)
var %sn = $gettok(%r2, 2, 32)
var %msg = $gettok(%r2, 3-, 32)
if ($gettok(%r2, 1, 32) == %n) {
var %sent = $true
notice %n ID: $gettok(%read, 1, 61) <-> Nick: %sn
notice %n Message: %msg
}
inc %while
}
if (%sent == $false) {
notice %n I don't remember any memo sent by you.
}
halt
}
elseif ($2 == -D) {
if ($3 == $null) {
var %dexist = $false
var %while = 2
while (%while <= $lines(memo.ini)) {
var %read = $read(memo.ini, %while)
var %r2 = $gettok(%read, 2-, 61)
var %from = $gettok(%r2, 1, 32)
if (%from == %n) {
var %dexist = $true
var %delid = %delid $gettok(%read, 1, 61) $+ ,
write -dl $+ $readn memo.ini
}
inc %while
}
if (%dexist == $false) {
notice %n I don't have a memo with that ID.
}
halt
}
var %dexist = $false
var %while = 2
while (%while < $lines(memo.ini)) {
var %read = $read(memo.ini, s, $3, $readn)
if ($3 $+ $chr(61) == $left(%read, $calc($len($3) + 1)) {
car %dexist = $true
var %r2 = $gettok(%read, 2-, 61)
var %from = $gettok(%r2, 1, 32)
if (%from == %n) {
write -dl $+ $readn memo.ini
notice %n Deleted, ID: %id
}
}
inc %while
}
if (%dexist == $false) {
notice %n I don't have a memo with that ID.
}
halt
}
else {
if ($3 == $null) {
notice %n No message/nick. Help: !memo -H
halt
}
var %wchans = $calc($numtok(%memo.chans,44) + 1)
var %while = 1
while (%while <= %wchans) {
inc %while
if ($2 ison $gettok(%memo.chans,%while,44)) {
notice %n The user is in $gettok(%memo.chans,%while,44) $+ $chr(46)
halt
}
}
inc %memo.id
writeini -n memo.ini Memos %memo.id %n $2 $3-
notice %n Memo to $2 added with ID: %memo.id
notice %n Message: $3-
halt
}
halt
:memo_help
notice %n Usage..: !memo [-N] [ID] [Nick] [Memotext]
notice %n -----------
notice %n List....: -L
notice %n Help....: -H
notice %n Send....: -A
notice %n Delete..: -D [ID]
notice %n -----------
notice %n Example: !memo -a Trasp Where did you go last night?
notice %n This will send Trasp the message "Where did you go last night?" when he joins the next time.
notice %n -
notice %n Example: !memo -d 41831
notice %n This will delete the memo with ID 41831. If you don't enter the ID all memos sent by you will be deleted.
notice %n -
notice %n You can send more then one line, seperate them with the character: $chr(124)
notice %n Do not mix the options. You could also use !m instead of !memo.
halt
}