This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

A script

Old posts that have not been replied to for several years.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

dollar wrote:
caesar wrote:$target == $botnick is not necesarly correct cos foo is not equal with FOO or FoO and so on, so either "string tolower" them or use "string equal -nocase $target $botnick"

This has been discussed 100 times before, why don't you understand it once and for all?
String equal BAAAAD, isbotnick GOOOOD!
isbotnick baddddddd, not compatible with my 1.1.5's ;x
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Well there are alot of methods for comparing to strings/variables.

You can change the case letters, yes I know but this was just to get the script working. There are many solutions availiable, depening upon your needs:

You can use all of these: (some have exceptions... though)

Code: Select all

if {($botnick == $target)} 
or

Code: Select all

if {([string tolower $botnick] == [string tolower $target])}
or

Code: Select all

if {([isbotnick $target])}
or

Code: Select all

if {([string equal -nocase $pattern $string])}
or

Code: Select all

if {([string compare -nocase $pattern $string])}
There maybe more types of string/variable comparison
methods other than this as well, of which I am not aware.

But all commands these will compare, some might have alot of
accessibility and some might be very limited and restricted.

All will give basically the same results, but some conditions
yeah might not work if lower and upper characters are present
while comparing with commands, which give limited access.

I mainly use string equal or string comparison commands when scripting.
But that was just a small example to get the guys script working.

There can be alot of variations as alot of string manipulation
commands such as equal, comapare, ==, !=, and botnick
manipulation isbotnick, botisop etc are availiable.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
d
dollar
Op
Posts: 178
Joined: Tue Oct 28, 2003 3:47 pm
Location: Netherlands

Post by dollar »

awyeah wrote:

Code: Select all

if {([string compare -nocase $pattern $string])}
Wrong, string compare would return 0 there.
dollar (or something similar) at:
#eggdrop / #tcl - undernet
#egghelp / #tcl / #eggtcl - efnet
#eggdrop.support / #tcl - quakenet
#eggdrop - ircnet
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

*string compare* always returns 0 if both strings are equal.

Code: Select all

if {(([string compare -nocase $pattern $string]) == 0)}
*string match* always returns 1 if both strings are equal.

Code: Select all

if {(([string equal -nocase $pattern $string]) == 1)}
or

Code: Select all

if {([string equal -nocase $pattern $string])}
Both these string equals would technically be the same.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked