Author Topic: Why does this not work?  (Read 4040 times)

BloodyRain

  • Guest
Why does this not work?
« on: June 29, 2004, 08:31:59 AM »
I wonder why this doesnt

work...

Normally LCase("TeStStriNG") should return "teststring" and LCase("!teSTstrING") should return

"!teststring".

But when I use this Script:

Code: [Select]
Sub

ONNOTICE(Message,Nickname,Host,ServerNumber)
dim Data

[Message is for example "!TestString

TS2"]

Data = Split(LCase(Message)," ")

[Data(0)  should be now

"!teststring"]
[Data(1)  should be now "ts2"]

if Data(0) =

"!teststring" then
  <Trigger>
end if
End Sub


it doesnt do

<Trigger>, why? It does <Trigger> when Message is "!teststring ts2"....

and i got another

problem:

Code: [Select]
Variable = True

If Variable = True then <Trigger>
If Variable = False then

<Trigger2>


sometimes it does trigger both Trigger when Variable = True, sometimes not, the

same if its False, but when it triggers one, it triggers automatic the other one too.

but when I use 0 for False and 1

for True if works correct. this is really confusing....

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Why does this not work?
« Reply #1 on: June 29, 2004, 10:04:10 AM »
Perhaps this "may" work for

you.
Code: [Select]
Data = Split(Message," ")

if lcase(Data(0)) =

"!teststring" then ...
if lcase(Data(1)) = "ts2" then

....



The Variable = True, use an else statement
Code: [Select]
Variable =

True
If Variable = True
... do this code
else
.... do this code
end if
The IceChat God

BloodyRain

  • Guest
Why does this not work?
« Reply #2 on: June 29, 2004, 03:47:48 PM »
sry with the lcase, I only testet it with a command which was

in another Script but I forgot it then so all commands reacted right but not the one I use for testing

but the thing

with the if Variable = True did I test enough

The Reaction in < > where they same, it didn't matter if Variable

was True or False

Code: [Select]
If Variable = True then
  <triggered>
end if

If Variable =

False then
  <NOTtriggered>
end if

If Variable <> True then
  <NOTtriggered>
end

if

If Variable <> False then
  <triggered>
end if


it looked like it

wasn't interressted in the value of Variable...

but I noticed one thing, the working If script that you told me

worked in the ONQUERY Sub but my If Block wasn't working in a Custom Sub which I used to React on Notice, Query and Text

without need to Write the full code 3 times and it worked ever except with this If = True Block

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Why does this not work?
« Reply #3 on: June 30, 2004, 03:08:17 AM »
Are you getting any script errors?
Try emailing the full

script the support@icechat.net , and I can look at it.
The IceChat God