Command "or" for npc

Join Discord

astral

Dedicated Member
Dedicated Member
Dec 14, 2012
109
3
45
Poland
will anyone tell me how to use the "or" command for npc?

I need to write a script that checks:

#IF
checknamelist [xxx\1.txt]
Goto @tele1
#IF
checknamelist [xxx\2.txt]
goto @tele2

because this solution does not work
 

Sanjian

Just a Mir2 Fan
VIP
Apr 28, 2011
3,957
5
2,074
350
East Sussex
Re: Command "or" for npc

#IF
checknamelist [xxx\1.txt]
#ACT
Goto @tele1
#ELSEACT

#IF
checknamelist [xxx\2.txt]
#ACT
goto @tele2
#ELSEACT
 
Upvote 0

zedina

Mir3 Dev
Legendary
Dec 22, 2005
3,168
1
1,017
340
will anyone tell me how to use the "or" command for npc?

I need to write a script that checks:

#IF
checknamelist [xxx\1.txt]
Goto @tele1
#IF
checknamelist [xxx\2.txt]
goto @tele2

because this solution does not work

if i remember right you need the list to be on envir folder to use command checknamelist BattlePoints.txt


Code:
#IF
            checknamelist BattlePoints.txt
#ACT
            goto @tele1
            break


#IF
            !checknamelist BattlePoints.txt
#ACT
            goto @tele2
            break




[@tele1]
#SAY
            You got enought points to teleport on  BattleGrounds!\


[@tele2]
#SAY
            You need to kill more monsters to achieve the enough points to enter to the BattleGrounds!\


And to use ELSEACT you need to check the value if is true or not to the int.


Code:
#IF
            checknamelist BattleGrounds.txt
#ACT
            goto @approval
#ELSEACT
            goto @denial



[@approval]
#SAY
            You can Enter.\



[@denial]
#SAY
         You cant Enter! \
 
Last edited:
Upvote 0

Far

tsniffer
Staff member
Developer
May 19, 2003
20,179
30
2,783
540
Re: Command "or" for npc

#IF
checknamelist [xxx\1.txt]
#ACT
Goto @tele1
#ELSEACT

#IF
checknamelist [xxx\2.txt]
#ACT
goto @tele2
#ELSEACT
Remove the #elseact and add break, and this would be correct

Sent from my SM-G930F using Tapatalk
 
Upvote 0

astral

Dedicated Member
Dedicated Member
Dec 14, 2012
109
3
45
Poland
if i remember right you need the list to be on envir folder to use command checknamelist BattlePoints.txt


Code:
#IF
            checknamelist BattlePoints.txt
#ACT
            goto @tele1
            break


#IF
            !checknamelist BattlePoints.txt
#ACT
            goto @tele2
            break




[@tele1]
#SAY
            You got enought points to teleport on  BattleGrounds!\


[@tele2]
#SAY
            You need to kill more monsters to achieve the enough points to enter to the BattleGrounds!\


And to use ELSEACT you need to check the value if is true or not to the int.


Code:
#IF
            checknamelist BattleGrounds.txt
#ACT
            goto @approval
#ELSEACT
            goto @denial



[@approval]
#SAY
            You can Enter.\



[@denial]
#SAY
         You cant Enter! \
yes I know that there must be a file with a nick in the envir folder.


The point is I need to check 5 files and run the appropriate teleport
 
Upvote 0

zedina

Mir3 Dev
Legendary
Dec 22, 2005
3,168
1
1,017
340
yes I know that there must be a file with a nick in the envir folder.


The point is I need to check 5 files and run the appropriate teleport


then do check ups to each stage


Code:
IF
checknamelist example.txt
#ACT
goto @Stage 1
#ELSEACT
break

[@Stage 1]
#IF
checknamelist example1.txt
#ACT
goto @Stage2
#ELSEACT
break
 
Upvote 0

Far

tsniffer
Staff member
Developer
May 19, 2003
20,179
30
2,783
540
then do check ups to each stage


Code:
IF
checknamelist example.txt
#ACT
goto @Stage 1
#ELSEACT
break

[@Stage 1]
#IF
checknamelist example1.txt
#ACT
goto @Stage2
#ELSEACT
break
No need for gotos, you can put multiple statements in a row

Sent from my SM-G930F using Tapatalk
 
Upvote 0

iJam

To the rhythm
VIP
Oct 8, 2007
1,522
99
195
London
will anyone tell me how to use the "or" command for npc?

I need to write a script that checks:

#IF
checknamelist [xxx\1.txt]
#ACT
Goto @tele1
break

#IF
checknamelist [xxx\2.txt]
#ACT
goto @tele2
break

because this solution does not work


inserted and highlighted what you missed
 
Upvote 0

Sanjian

Just a Mir2 Fan
VIP
Apr 28, 2011
3,957
5
2,074
350
East Sussex
Re: Command "or" for npc

Remove the #elseact and add break, and this would be correct

Sent from my SM-G930F using Tapatalk

i thought #ELSEACT / #ELSESAY ended an #IF so you could do multiple #IFs in one section, has the need for break been added?
 
Upvote 0

Far

tsniffer
Staff member
Developer
May 19, 2003
20,179
30
2,783
540
A break will stop the rest from being evaluated if its true.

No need for elseact unless there is something to go in them

Sent from my SM-G930F using Tapatalk
 
Upvote 0

idaBigA

Holley Mir 3!!
VIP
Oct 28, 2003
1,966
110
310
Stoke, UK
Sorry guys, just have to throw this one in here... you can just use the OR command.

Code:
#IF
Equal A0 "Sting"
Or Equal A0 "StingGM"
Or Equal A0 "GMSting"
#ACT
Do something
 
Upvote 0

Far

tsniffer
Staff member
Developer
May 19, 2003
20,179
30
2,783
540
Sorry guys, just have to throw this one in here... you can just use the OR command.

Code:
#IF
Equal A0 "Sting"
Or Equal A0 "StingGM"
Or Equal A0 "GMSting"
#ACT
Do something
Never knew that was a thing

Sent from my SM-G930F using Tapatalk
 
Upvote 0

Far

tsniffer
Staff member
Developer
May 19, 2003
20,179
30
2,783
540
Re: Command "or" for npc

I don't know C# but why would it need to check further if it finds a matching item when using an OR command?
With c# its pretty much an unused feature unless you have them as function calls which perform other operations.

What would this do if you had 4 if statements and only 2 had an or?

Sent from my SM-G930F using Tapatalk
 
Last edited:
Upvote 0

idaBigA

Holley Mir 3!!
VIP
Oct 28, 2003
1,966
110
310
Stoke, UK
Code:
#IF
ISADMIN
Equal A0 "Sting"
Or Equal A1 "StingGM"
Or Equal A2 "GMSting"
#SAY
One of you is called Sting and you are carrying a Frog and a Spoon!

You mean something like this? Not sure though as I have never tried it although should work. I'll try it now...

Just tested, and you can have multiples in i.e.

Code:
#IF
Equal A3 "Bob"
Or Equal A3 "Sting"              
Equal A1 "A"
Or Equal A1 "B"
Equal A2 "B"
#SAY
Blah
 
Last edited:
Upvote 0

Far

tsniffer
Staff member
Developer
May 19, 2003
20,179
30
2,783
540
Just tested, and you can have multiples in i.e.

Code:
#IF
Equal A3 "Bob"
Or Equal A3 "Sting"              
Equal A1 "A"
Or Equal A1 "B"
Equal A2 "B"
#SAY
Blah

So does that group them - doing something like this?

Code:
Equal A3 "Bob" Or Equal A3 "Sting"              
Equal A1 "A" Or Equal A1 "B"
Equal A2 "B"
 
Upvote 0