mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Hello,

I wonder if this could be possible to be added into the mIRC

e.g:

ON *:TEXT:*:?: { if ($1- ischar) { echo -s WARNING: The $nick just used the $v1 character's private } }

Thanks, ^WeSt

Last edited by westor; 03/12/09 03:21 PM.

Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Could you please elaborate?

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Do you mean if ($len($1-) == 1) { ?
If so, probably won't be added, you're too lazy seriously ~


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Yeah, please elaborate on what you mean. ischar to mean seems like you're wanting to know that it's a character (i.e. not a number of symbol -- isalplha handles that). But what you put as the warning doesn't seem to make sense -- "character's private"?

Also, keep in mind that $v1 is the result of the check. An is___ check will return $true or $false, which I doubt is what you're expecting in your example.

If you meant it's a single character,then $len() == 1 is just as easy as mentioned. If you mean something else entirely, please explain. A sample input and output for the example script would help us to understand what you mean.

Last edited by Riamus2; 03/12/09 03:54 PM.

Invision Support
#Invision on irc.irchighway.net
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Quote:
Also, keep in mind that $v1 is the result of the check. An is___ check will return $true or $false, which I doubt is what you're expecting in your example.
So wrong, $v1 return the first part of the condition.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You're right. I always use it with X == Y format and when I actually think of that, I see my error. I wasn't thinking of is___ correctly (that "is" is basically the == and ___ is the second part of the condition). I was incorrectly thinking of it as all the first part of the condition. Oops. smile

Shows how much I use those is___ checks while also displaying the result using $v1... i.e. never.


Invision Support
#Invision on irc.irchighway.net
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
if you actually mean to test $len($1) == 1 like the others are assuming, that should not be considered the behaviour of "ischar" imo.

The behaviour of the is* text matchers (isalpha, isalnum) don't test single characters, so if "ischar" would be misleading. "ischar" looks like you're asking the question: is $1 a set of characters? ..similar to "isalpha" (is $1 a set of alpha chars).

If this is really about testing a single char, you'd want if ($1 issinglechar), but that's just getting superfluous. Just use the len check if that's what you want.

If you mean something else, you need to *explain*. You can't expect people to understand you from a single line of an ambiguous example.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
I mean man when the $1- has any character's in then echo that the $1- has characters the $v1 was an silly example to saw you what i mean

e.g:

if ($1- ischar) { echo Yes the $1- is a char! }


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Mar 2004
Posts: 54
Z
Zed Offline
Babel fish
Offline
Babel fish
Z
Joined: Mar 2004
Posts: 54
A simple solution can be this:

if ($0) echo $1-

or, if $1- can be $null: (if alias is called like this: $test(,,) )

if ($1- != $null) echo $1-

Last edited by Zed; 04/12/09 04:07 PM.
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
lol? that has not sence with that i want to tell you.


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Originally Posted By: westor
I mean man when the $1- has any character's in then echo that the $1- has characters the $v1 was an silly example to saw you what i mean

e.g:

if ($1- ischar) { echo Yes the $1- is a char! }

You're still not making any sense. Give us examples!

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
As mentioned, give an example INPUT and OUTPUT rather than just the script as we obviously aren't understanding what you want. If all you're looking for is whether or not it's letters, that's what isalpha is for. If you want to know if there is data, use if ($1-) { } or just if ($1) { } . But without an actual example of input and what you expect the output to be, no one seems to know what you want.


Invision Support
#Invision on irc.irchighway.net
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
You want to test if "$1" has "characters" in it? As in, if $1 exists?

if ($1 != $null) { echo YES IT IS. }


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
OK, lets be more specific


ON *:TEXT:*:?: {
; THE FIRST IF IS THE USUAL EXAMPLE
if ($1 == $chr(35)) { echo Yes the $1 is a character }
; THE SECOND IF IS THAT THAT I WANT TO GIVE YOU EXAMPLE
if ($1 ischar) { echo Yes the $1 is a character }
}

NOTE: I want to tell you that the ischar to return if there are any $chr(*) inside an IF, as there exist the if ($1 isnum) { echo Yes it is an number }, It's easy and you can understand what i mean, ok my english is little poor but it is an good idea who those who has understand!

Last edited by westor; 05/12/09 04:03 PM.

Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
You need to tell us what you mean when you say "character".

Do you mean:
letters?
numbers?
punctuation?
control codes? (0-31)
all basic ascii (32-127)?
all extended ascii (128-255)?
all ascii (32-255)?
all unicode characters?

-genius_at_work

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
And how, realistically, is this different from
Code:
if ($1 != $null) { echo Yes the $1 is a character}
as suggested (with a slight alteration to the wording in the echo) by argv0 in the post located here
ok, you'll have to scroll down, as referencing the reply directly only brings you to the top of the original topic

Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
All the $chr(*) return character's


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Dec 2008
Posts: 1,515
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Originally Posted By: RusselB
And how, realistically, is this different from
Code:
if ($1 != $null) { echo Yes the $1 is a character}
as suggested (with a slight alteration to the wording in the echo) by argv0 in the post located here
ok, you'll have to scroll down, as referencing the reply directly only brings you to the top of the original topic


I had never give this example just look the other new that i gave!


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
He was giving YOU an example with that. You still have not given a sample INPUT and OUTPUT (something I've requested multiple times). If you want to know if it is a single value, use:

if ($len($1) == 1) {}

That will tell you it's a single character. If you want only letters, use isalpha. If you want anything except numbers, use !isnum. If you want anything and any length, use:

if ($1 != $null) {}

A $chr() is any ascii character (including numbers). The only thing you'd filter out that way would be unicode. Is that what you're trying to do? Check if it's unicode? Really, you have to explain what you're looking for. If no one here knows what you are requesting, then it's a pretty good bet that you aren't explaining it well.

Give input and output examples (not more script examples).

Such as:
Quote:

<nick> H
<bot> This is a character.
<nick> Ha
<bot> This is not a character.
<nick> 1
<bot> This is a character.
<nick> "
<bot> This is not a character.
<nick> &#12486;
<bot> This is a character.


This is the kind of example we need to know what you're asking for. Change it to show the right outputs and, if necessary, add or remove some of the examples in there.


Invision Support
#Invision on irc.irchighway.net
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
westor:

ANY text is a $chr(*), therefore ANYTHING ischar, therefore:

if ($1 != $null) is what you want.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Page 1 of 2 1 2

Link Copied to Clipboard