mIRC Home    About    Download    Register    News    Help

Print Thread
#172792 16/03/07 12:50 AM
Joined: Mar 2007
Posts: 4
Z
Zr69 Offline OP
Self-satisified door
OP Offline
Self-satisified door
Z
Joined: Mar 2007
Posts: 4
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 ?

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.

Joined: Mar 2007
Posts: 4
Z
Zr69 Offline OP
Self-satisified door
OP Offline
Self-satisified door
Z
Joined: Mar 2007
Posts: 4
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

Joined: Oct 2006
Posts: 342
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Oct 2006
Posts: 342
I think tokens are the best way $numtok $istok $addtok


learn learn learn
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.

Joined: Mar 2007
Posts: 4
Z
Zr69 Offline OP
Self-satisified door
OP Offline
Self-satisified door
Z
Joined: Mar 2007
Posts: 4
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

Joined: Oct 2006
Posts: 342
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Oct 2006
Posts: 342
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


learn learn learn
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.


Link Copied to Clipboard