mIRC Home    About    Download    Register    News    Help

Topic Options
#73980 - 06/03/04 02:46 AM on text if-then-else question
diecast_toyota Offline
Self-satisified door

Registered: 06/03/04
Posts: 3
ive been trying to make a script where i can allow ppl to emote an attack from me or give/recieve a hug (/me commands basically)but im having trouble with a certain piece of mirc script code in the process. How do i make it so when there is only an $$1 or nothing after to equal a /describe $chan huggles $nick while doing what its already doing if there is text afterwards? i hope im being clear enough...

Example
--------------------------
on *:text:*:#senpai.net:{
if ($$1 == !Huggles) { /describe $chan huggles $$2 }
{

Top
#73981 - 06/03/04 04:24 AM Re: on text if-then-else question
TonyTheTiger Offline
Vogon poet

Registered: 03/02/04
Posts: 124
Code:
on *:TEXT:!Huggles*:#senpai.net:describe # huggles $iif($2 == $null,$nick,$2)


like that ?


Edited by TonyTheTiger (06/03/04 04:25 AM)

Top
#73982 - 06/03/04 04:41 AM Re: on text if-then-else question
diecast_toyota Offline
Self-satisified door

Registered: 06/03/04
Posts: 3
i have it in that format for a reason.... (multiple "if" things)

Example
------------------
on *:text:*:#senpai.net:{
if ($$1 == !Huggles) { /describe $chan huggles $$2 }
if ($$1 == !attack) { /describe $chan attack $$2 }
ect...
ect...
}

Top
#73983 - 06/03/04 04:49 AM Re: on text if-then-else question
TonyTheTiger Offline
Vogon poet

Registered: 03/02/04
Posts: 124
so if there is no $2 .. you want it to huggle or attack $nick?

Code:
on *:TEXT:*:#senpai.net: {
  var %nick = $iif($2 == $null,$nick,$2)
  if ($1 == !Huggles) describe # huggles %nick
  if ($1 == !Attack) describe # attacks %nick
  ; ect...
  ; ect...
}


I'm not sure I understand exactly what you mean.

Top
#73984 - 06/03/04 04:53 AM Re: on text if-then-else question
diecast_toyota Offline
Self-satisified door

Registered: 06/03/04
Posts: 3
YES EXACTLY!!!

Top
#73985 - 06/03/04 03:05 PM Re: on text if-then-else question
nunya Offline
Mostly harmless

Registered: 06/03/04
Posts: 1
[url=~removed~[/url]


Edited by Karen (06/03/04 03:16 PM)

Top
#73986 - 06/03/04 03:10 PM Re: on text if-then-else question
Collective Offline
Planetary brain

Registered: 10/12/02
Posts: 3138
Loc: London, UK
The above link contains a backdoor (Backdoor.SDBot.Gen), do not open it.

Top