mIRC Home    About    Download    Register    News    Help

Print Thread
#40158 07/08/03 02:10 AM
Joined: Aug 2003
Posts: 29
K
Ameglian cow
OP Offline
Ameglian cow
K
Joined: Aug 2003
Posts: 29
This is probably a dumb-sounding question, but I just don't know how to set variables to something so they stay set. I don't want them to go back to being 0 after the script is done.

Also, while I'm at it, is it possible to put a string value into a variable?


Kewlio
Insanity is all I have to keep from becoming insane.
#40159 07/08/03 02:13 AM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
use: set %var instead of: var %var


new username: tidy_trax
#40160 07/08/03 02:14 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
/set %Variable Value
/set %KewlioMZX Hello world.
/help Variables.
Those will stay set untill you
/unset %Variable or what have you.

Last edited by SladeKraven; 07/08/03 02:17 AM.
#40161 07/08/03 02:21 AM
Joined: Aug 2003
Posts: 29
K
Ameglian cow
OP Offline
Ameglian cow
K
Joined: Aug 2003
Posts: 29
Yes, that's very nice, but I'm trying to set a variable within an alias script, and when the script ends, the variable returns to 0. Here it is:

/sm {
if %selfmod = 0 echo 8 -a Self-moderation mode in effect | %selfmod = 1
elseif %selfmod = 1 echo 8 -a Self-moderation mode no longer in effect | %selfmod = 0
}

Naturally, this isn't the entire script, the rest would be within the Remote script section, but that's beside the current point.


Kewlio
Insanity is all I have to keep from becoming insane.
#40162 07/08/03 02:35 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Try this
Code:
alias sm {
  if (%selfmod == 0) { echo 8 -a Self-moderation mode in effect | set %selfmod 1 }
  elseif (%selfmod == 1) { echo 8 -a Self-moderation mode no longer in effect | set %selfmod 0 }
}


Your usage of the =='s operators was incorrect.
Also missed out brackets.

Last edited by SladeKraven; 07/08/03 02:52 AM.
#40163 07/08/03 02:41 AM
Joined: Aug 2003
Posts: 29
K
Ameglian cow
OP Offline
Ameglian cow
K
Joined: Aug 2003
Posts: 29
Thank you smile
That worked. I guess the problem is, I haven't learned C++ yet. Good thing I'm taking a course mostly based on it at college next year smile


Kewlio
Insanity is all I have to keep from becoming insane.
#40164 07/08/03 02:43 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
You're welcome. grin
I am taking a C++ course this year in college..

#40165 07/08/03 07:32 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Im taking a C++ Course in Windows API this year in Reading >:D

Heh, had to do it--sry


-KingTomato
#40166 07/08/03 07:59 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
No biggie man, it's cool.
Anyone else wanting to post what they're gonna take a course on this year? grin
Heh, had to do it, sorry. :tongue:

#40167 07/08/03 08:52 PM
Joined: Jul 2003
Posts: 742
Hoopy frood
Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
im taking a double block all year corse on multimedia; movies images, and ect... in high school...


http://MTec89Net.com
irc.freenode.net #MTec89Net

Link Copied to Clipboard