|
|
Joined: Jun 2003
Posts: 5
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Jun 2003
Posts: 5 |
Is it possible to use part of a variable? here is my script on *:TEXT:*!mods*:#E*R*S: { /msg $chan !hm Current ingame mods are @ $+ %peramods ; % $+ %permods ; + $+ %pertmods } i want it toput the @, % or + infront each of the names in my variables can this be done?
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
Hoopy frood
Joined: May 2003
Posts: 2,265 |
1: unless thyre supposed to be, them variables have different names. 2: change the ;'s to ,'s because ; makes something a comment
new username: tidy_trax
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
on *:TEXT:*!mods*:#E*R*S: {
set %i 1
set %peramods $nick(#,%i)
if (%peramods == $null) { goto done }
if (%peramods isop $chan) { msg $chan %peramods is an op on $chan }
if (%peramods ishop $chan) { msg $chan %peramods is a halfop on $chan }
inc %i
goto next
:done
}
Hmmz, is this ok?
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
You could also do
on *:TEXT:*!mods*:[color:red]#[/color]: {
set %i 1
set %peramods $nick(#,%i)
if (%peramods == $null) && ($me isop $chan) { goto done }
if (%peramods isop $chan) && ($me isop $chan) { msg $chan %peramods is an op on $chan }
if (%peramods ishop $chan) && ($me isop $chan) { msg $chan %peramods is a halfop on $chan }
inc %i
goto next
:done
}
Which would trigger in any room you have ops in
Last edited by SladeKraven; 02/07/03 12:49 AM.
|
|
|
|
Joined: Dec 2002
Posts: 2,809
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,809 |
From the help file: You can add comments to your scripts by using the ; semi-colon at the start of a line.
Those semicolon's aren't at the start of a line, therefore they are not considered comments. There is no reason to replace the semicolon's with anything else.
|
|
|
|
Joined: Jun 2003
Posts: 5
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Jun 2003
Posts: 5 |
maybe u dont understand what im trying to do here I run a server for a game and i have ingame moderators names set in those variables. as the code is now it will say this to the people in the game. Current ingame mods are @name name name ; %name name ; +name name what i want it to do is this Current ingame mods are @name ; @name ; @name ; %name ; %name ; +name ; +name
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
Maybe you don#t understand that ";'s" are comments. Try @name $chr(59) %name $chr(59) +name.
|
|
|
|
Joined: Jun 2003
Posts: 5
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Jun 2003
Posts: 5 |
it works fine with the ; in it thats not the problem.
the problem is trying to split up the names that are in the variables. i was just wondering if that is possible
|
|
|
|
Joined: Jan 2003
Posts: 2,523
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 2,523 |
Try @ $+ $replace(%peramods,; $+ $chr(32),; @) ; $&
% $+ $replace(%permods,; $+ $chr(32),; %) ; $&
+ $+ $replace(%pertmods,; $+ $chr(32),; +) ;
/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
|
|
|
|
Joined: Jun 2003
Posts: 5
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Jun 2003
Posts: 5 |
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
Hoopy frood
Joined: May 2003
Posts: 2,265 |
how about you just add the ;'s to the variable, that will make it a lot easier.
new username: tidy_trax
|
|
|
|
Joined: Dec 2002
Posts: 169
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 169 |
Ok, I assume your variables look like this: %peramods name name name %permods name name %pertmods name name Try using this (slightly modified from qwerty's)
msg $chan !hm Current ingame mods are $&
@ $+ $replace(%paramods,$chr(32),$chr(32) ; @) $&
; % $+ $replace(%parmods,$chr(32),$chr(32) ; %) $&
; + $+ $replace(%partmods,$chr(32),$chr(32) ; +)
|
|
|
|
Joined: Jun 2003
Posts: 5
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Jun 2003
Posts: 5 |
|
|
|
|
Joined: Jan 2003
Posts: 2,523
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 2,523 |
Oops, I didn't pay attention to the original example and thought that all nicks are separated by " ; ". No wonder why it didn't work... Thanks.
/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
|
|
|
|
|
|