mIRC Home    About    Download    Register    News    Help

Print Thread
#104231 01/12/04 01:55 AM
Joined: Oct 2004
Posts: 31
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Oct 2004
Posts: 31
I want users to be able to add names to my script
i have on


on 1:text:!addname:#: {
XXX
}

on 1:text:!listname:#: {
XXX
}

I want them to be able to type !addname and have the variable %name(the next number) to store their name

If Bob is first and types !addname, %name1 will become Bob
Then it adds one to the numberso the next person, Joe types !addname and %name2 becomes Joe
Then the next person is %name3 and so on

then when a person types !listname it notices the nick
%name1 , %name2 , and so on until its out of filled names
if 10 people added their names, it would notice them all ten names, no more no less

Is this possible or is it way too complex?

#104232 01/12/04 02:51 AM
Joined: Mar 2004
Posts: 175
Vogon poet
Offline
Vogon poet
Joined: Mar 2004
Posts: 175
Code:
On *:TEXT:*:#: {
If ($1 == !AddName) {
set $($+(%Name,$iif($Var(%Name*,$Var(%Name*,0)),$Calc($Right($v1,-5) + 1),1)),2) $Nick
}
If ($1 == !ListName) {
var %a = 1
While ($Var(%Name*,%a)) {
If ($Calc($Len(%b) + $Len($Chr(44) $Var(%Name*,%a).data)) >= 400) {
.notice $Nick %b
unset -l %b
}
var %b = $iif(%b,%b $+ ,) $Var(%Name*,%a).data
inc %a
}
If (%b) { .notice $Nick $+(%b,.) }
}
}


I'm not sure if this will work, but give it a shot.

Last edited by Relinsquish; 01/12/04 02:59 AM.

- Relinsquish
#104233 01/12/04 08:34 PM
Joined: Oct 2004
Posts: 31
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Oct 2004
Posts: 31
Nope frown
gives a set error for line 3

#104234 01/12/04 09:01 PM
Joined: Mar 2004
Posts: 175
Vogon poet
Offline
Vogon poet
Joined: Mar 2004
Posts: 175
Alright, sorry about that. Here is the fixed script:

Code:
On *:TEXT:*:#: {
If ($1 == !AddName) {
set %Name [ $+ [ $Calc($Right($Var(%Name*,$Var(%Name*,0)),-5) + 1) ] ] $Nick
}
If ($1 == !ListName) {
var %a = 1
While ($Var(%Name*,%a)) {
If ($Calc($Len(%b) + $Len($Chr(44) $Var(%Name*,%a).data)) >= 400) {
.notice $Nick %b
unset -l %b
}
var %b = $iif(%b,%b $+ ,) $Var(%Name*,%a).data
inc %a
}
If (%b) { .notice $Nick $+(%b,.) }
}
}


- Relinsquish
#104235 02/12/04 08:33 PM
Joined: Oct 2004
Posts: 31
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Oct 2004
Posts: 31
thanx for the first part
the seond part (list) gives a really weird output thouhg

#104236 02/12/04 09:08 PM
Joined: Mar 2004
Posts: 175
Vogon poet
Offline
Vogon poet
Joined: Mar 2004
Posts: 175
Code:
On *:TEXT:*:#: {
If ($1 == !AddName) {
set %Name [ $+ [ $Calc($Right($Var(%Name*,$Var(%Name*,0)),-5) + 1) ] ] $Nick
}
If ($1 == !ListName) {
var %a = 1
While ($Var(%Name*,%a)) {
If ($Calc($Len(%b) + $Len($Var(%Name*,%a).data)) >= 400) {
.notice $Nick %b
unset -l %b
}
var %b = %b $Var(%Name*,%a).data
inc %a
}
If (%b) { .notice $Nick %b }
}
}


- Relinsquish
#104237 04/12/04 08:41 AM
Joined: Apr 2003
Posts: 342
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Apr 2003
Posts: 342
Use hash tables... that's all I have to say.


Beware of MeStinkBAD! He knows more than he actually does!
#104238 10/12/04 07:09 PM
Joined: Oct 2004
Posts: 31
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Oct 2004
Posts: 31
Quote:
Use hash tables... that's all I have to say.


hasktables (sry, im still new @ this)


Link Copied to Clipboard