mIRC Homepage
Posted By: Zr69 !add event !event script - 16/03/07 12:50 AM
hi i have been trying to make a !addevent <event> script to add event into var's and then on !event i could say the current events
i have been trying for the last few hours and nothing has come out working...

could someone please make me one ?
Posted By: RusselB Re: !add event !event script - 16/03/07 01:48 AM
Similar requests have been requested a fair bit.
Code:
on *:text:!addevent*:#:{
  .write -il1 events.txt $2-
}
on *:text:!event:#:{
  .play $nick events.txt
}

If this isn't what you meant, then please clarify.
Posted By: Zr69 Re: !add event !event script - 16/03/07 08:35 PM
yes thats good but i would like only a selected amount of people(3) and i should have away for adding them in the list like /add nick
Posted By: learn3r Re: !add event !event script - 16/03/07 11:27 PM
I think tokens are the best way $numtok $istok $addtok
Posted By: RusselB Re: !add event !event script - 17/03/07 12:00 AM
While learn3r has a good idea about using tokens, for something like this, I think using mIRC's user list is a better idea.
Code:
on *:text:!adduser*:*:{
  .user add $$2-
}
on *:text:!remuser*:*:{
  .user rem $$2-
}
alias user {
  var %users = $replace($2-,$chr(44),$chr(32)), %a = 1, %b = $numtok(%users,32)
  while %a <= %b {
    $iif($1 == add,.auser -a,.ruser) user $gettok(%users,%a,32)
    inc %a
  }
}
on user:text:!addevent*:#:{
  .write -il1 events.txt $2-
}
on user:text:!event:#:{
  .play $nick events.txt
}


To add/remove valid users via a client other than the one running the code:
!adduser <nick(s)>
!remuser <nick(s)>

To add/remove valid users via the client running the code:
/user add <nick(s)>
/user rem <nick(s)>

If specifying multiple nicks, they can be space and/or comma separated.
Posted By: Zr69 Re: !add event !event script - 17/03/07 03:52 AM
thankyou so much ill keep you posted on how its working but i think now i can pretty much fix it if something goes wrong

thanks again
Posted By: learn3r Re: !add event !event script - 17/03/07 08:02 PM
the first way that i think is token because he se's

Quote:
only a selected amount of people(3)


but userlist is a better idea good work
Posted By: RusselB Re: !add event !event script - 17/03/07 09:18 PM
I've lost track of the number of times people have asked for a restriction so that only a certain number of people can use it, and then a few days later they want to add more people. Using the userlist allows the op to limit it to three if they wish, or if they want to expand it later, the expansion is already coded..no need to change the code to allow more people.
© mIRC Discussion Forums