mIRC Home    About    Download    Register    News    Help

Print Thread
#40171 07/08/03 02:58 AM
Joined: Aug 2003
Posts: 29
K
Ameglian cow
OP Offline
Ameglian cow
K
Joined: Aug 2003
Posts: 29
OK, here's another question... In the "on *:input:---" command, is there a way to distinguish whether I use a /command or whether I type in a normal message?


Kewlio
Insanity is all I have to keep from becoming insane.
#40172 07/08/03 03:01 AM
Joined: Feb 2003
Posts: 79
A
Babel fish
Offline
Babel fish
A
Joined: Feb 2003
Posts: 79
on *:INPUT:*: {
if ($left($1,1) == /) { return $1- | halt }
ect...
}

its important that part on the top, unless u want something to go first....

#40173 07/08/03 03:11 AM
Joined: Aug 2003
Posts: 29
K
Ameglian cow
OP Offline
Ameglian cow
K
Joined: Aug 2003
Posts: 29
OK, what I want to do doesn't seem to be working.
Here's the tentative script:

on *:input:#:{
if (%selfmod == 1) + ($left($1,1) != /) { /echo 4 -at SELF-MODERATION ON: 7Cannot chat in any channel | /halt }
}

I'm not even sure if this is valid script (because of the +)... The ifs confuse me... crazy


Kewlio
Insanity is all I have to keep from becoming insane.
#40174 07/08/03 03:17 AM
Joined: Feb 2003
Posts: 79
A
Babel fish
Offline
Babel fish
A
Joined: Feb 2003
Posts: 79
on ^*:input:#:{
if ($left($1,1) != /) { what to do when its a command | halt }
if (%selfmod == 1) { what to do when its a message | halt }
else { what to do when its not a command or msg... }
haltdef
}

if its still not right just tell me what u wanna do.
a note, its not if () + () its &&

#40175 07/08/03 03:24 AM
Joined: Aug 2003
Posts: 29
K
Ameglian cow
OP Offline
Ameglian cow
K
Joined: Aug 2003
Posts: 29
The snippet you proposed wasn't really what I needed. However, the && tip fixed me right up. Thank you smile


Kewlio
Insanity is all I have to keep from becoming insane.
#40176 07/08/03 03:27 AM
Joined: Feb 2003
Posts: 79
A
Babel fish
Offline
Babel fish
A
Joined: Feb 2003
Posts: 79
YAY lol...if u need any other help u can just IM me instead of hitting refresh over and over or checking ur email constantly...lol..ur doin pretty basic stuff so i could probably be of use

AIM: Ancyker
MSN: Ancyker@hotmail.com
IRC: /server 216.65.55.76 6667 ( #Xeronic )

Your welcome for the help and happy scripting!

#40177 07/08/03 08:31 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
You really shouldn't spam your e-mail address, let alone IRC servers. Even if it is for helping purposes.

#40178 07/08/03 09:25 PM
Joined: Dec 2002
Posts: 117
R
Vogon poet
Offline
Vogon poet
R
Joined: Dec 2002
Posts: 117
Actually, if you really want to catch commands the right way:
Code:
on *:INPUT:*: {
  if (($left($1,1) isin $+(/,$cmdchar)) && (!$ctrlenter)) { its a command }
  else { its text }
}

Not like many people change their command char (note that / will still be recognised as command char if you do) but I think being able to send lines starting with / by pressing [ctrl][enter] is a nice feature, and it would be a shame to script it out.


$input(Me like stars, You too?)
#40179 07/08/03 09:31 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
$cmdchar doesn't return anything for me.

#40180 07/08/03 09:54 PM
Joined: May 2003
Posts: 215
Fjord artisan
Offline
Fjord artisan
Joined: May 2003
Posts: 215
It should be...

Code:
if (($left($1,1) isin $+(/,$readini($mircini,text,commandchar)))


- Jason
#40181 07/08/03 10:26 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
No, it should be:
Code:
if (($left($1,1) isin $+(/,$readini($mircini,text,commandchar)))[color:red])[/color]

* /if: invalid format (line 2, script.ini)

#40182 07/08/03 10:41 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
That wasn't the entire line though, lammkott was only correcting the first part of the if command that Rich used, i.e.
if (($left($1,1) isin $+(/,$readini($mircini,text,commandchar))) && (!$ctrlenter)) { its a command } works fine, add your extra ) and it doesn't.

#40183 07/08/03 10:46 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Well, I was just adding on to lammkott's post, when I added the extra ) it worked fine.
Code:
on *:INPUT:*: {
  if (($left($1,1) isin $+(/,$readini($mircini,text,commandchar)))) { $1- | halt }
  else { msg $active $1- | halt }
}

#40184 07/08/03 10:49 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Yes, but lammkott was only correcting the first part of Rich's if command, not all of it, i.e. "&& (!$ctrlenter))" should be on the end.

#40185 07/08/03 10:57 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Sorry, I didn't know. mad

#40186 08/08/03 01:40 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
here's a question, why is your condition surrounded twice by parenthesis?

if (($left($1,1) isin $+(/,$readini($mircini,text,commandchar))))


-KingTomato

Link Copied to Clipboard