 |
decus666 Newbie
Joined: 19 Aug 2010 Posts: 3
|
Posted: Thu Sep 02, 2010 2:51 am
hidden room searhc script always returning southeast |
got this script from an imm to find hidden rooms. when it runs it checks each direction then reports the hidden directions. problem is it always says southeast is hidden even though theres no room there. heres the code:
#VAR hNorth {0}
#VAR hSouth {0}
#VAR hEast {0}
#VAR hWest {0}
#VAR hUp {0}
#VAR hDown {0}
#VAR hSW {0}
#VAR hSE {0}
#VAR hNE {0}
#VAR hNW {0}
#VAR eNorth {0}
#VAR eSouth {0}
#VAR eEast {0}
#VAR eWest {0}
#VAR eUp {0}
#VAR eDown {0}
#VAR eNE {0}
#VAR eNW {0}
#VAR eSE {0}
#VAR eSW {0}
#TRIGGER "ending" {Exits: %1.} {a = 1;b = %numwords( %1);eNorth = 0;eSouth = 0;eEast = 0;eWest = 0;eUp = 0;eDown = 0;eSW = 0;eSE = 0;eNE = 0;eNW = 0;#T- rName;#T- blah133;#T- ending;#WHILE (@A <= @B) {#IF (%word( %1, @A) = "south") {eSouth = 1;hSouth = 0} {};#IF (%word( %1, @A) = "north") {eNorth = 1;hNorth = 0} {};#IF (%word( %1, @A) = "east") {eEast = 1;hEast = 0} {};#IF (%word( %1, @A) = "west") {eWest = 1;hWest = 0} {};#IF (%word( %1, @A) = "up") {eUp = 1;hUp = 0} {};#IF (%word( %1, @A) = "down") {eDown = 1;hDown = 0} {};#IF (%word( %1, @A) = "southeast") {eSE = 1;hSE = 0} {};#IF (%word( %1, @A) = "southwest") {eSW = 1;hSW = 0} {};#IF (%word( %1, @A) = "northeast") {eNE = 1;hNE = 0} {};#IF (%word( %1, @A) = "northwest") {eNW = 1;hNW = 0} {};#ADD A 1};#IF (@hSouth = 1) {#SAY Hidden Exit: South} {};#IF (@hNorth = 1) {#SAY Hidden Exit: North} {};#IF (@hEast = 1) {#SAY Hidden Exit: East} {};#IF (@hWest = 1) {#SAY Hidden Exit: West} {};#IF (@hUp = 1) {#SAY Hidden Exit: Up} {};#IF (@hDown = 1) {#SAY Hidden Exit: Down} {};#IF (@hSW = 1) {#SAY Hidden Exit: Southwest} {};#IF (@hSE = 1) {#SAY Hidden Exit: Southeast} {};#IF (@hNW = 1) {#SAY Hidden Exit: Northwest} {};#IF (@hNE = 1) {#SAY Hidden Exit: Northeast} {}} "" {disable}
#TRIGGER "rName" {~<~>-} {#T- rName;#IF (@lastDir = "north") {hNorth = 1} {};#IF (@lastDir = "south") {hSouth = 1} {};#IF (@lastDir = "east") {hEast = 1} {};#IF (@lastDir = "west") {hWest = 1} {};#IF (@lastDir = "up") {hUp = 1} {};#IF (@lastDir = "down") {hDown = 1} {};#IF (@lastDir = "northwest") {hNW = 1} {};#IF (@lastDir = "northeast") {hNE = 1} {};#IF (@lastDir = "southwest") {hSW = 1} {};#IF (@lastDir = "southeast") {hSE = 1} {}} "" {disable}
#TRIGGER "blah133" {No such board.} {#T- blah133;#IF (@lastDir = "north") {la south} {#IF (@lastDir = "south") {la east} {#IF (@lastDir = "east") {la west} {#IF (@lastDir = "west") {la up} {#IF (@lastDir = "up") {la down} {#IF (@lastDir = "down") {la northeast} {#IF (@lastDir = "northeast") {la northwest} {#IF (@lastDir = "northwest") {la southwest} {#IF (@lastDir = "southwest") {la southeast} {#IF (@lastDir = "southeast") {#T+ ending;look} {}}}}}}}}}}} "" {disable}
#ALIAS la {#T+ rName;#T+ blah133;look %1;lastDir = %1;gb 100}
#ALIAS cl {#T+ rName;hNorth = 0;hSouth = 0;hEast = 0;hWest = 0;hUp = 0;hDown = 0;hSW = 0;hSE = 0;hNE = 0;hNW = 0;eNorth = 0;eSouth = 0;eEast = 0;eWest = 0;eUp = 0;eDown = 0;eNE = 0;eNW = 0;eSE = 0;eSW = 0;la north}
#ALIAS bl {~l @lastDir;#T+ ending}
it creates 3 alias's and 3 triggers
any ideas why this is having problems? |
|
|
|
 |
decus666 Newbie
Joined: 19 Aug 2010 Posts: 3
|
Posted: Sun Sep 05, 2010 8:25 pm |
the alias' it creates are:
la
#T+ rName
#T+ blah133
look %1
lastDir = %1
gb 100
cl
#T+ rName
hNorth = 0
hSouth = 0
hEast = 0
hWest = 0
hUp = 0
hDown = 0
hNE = 0
hNW = 0
hSE = 0
hSW = 0
eNorth = 0
eSouth = 0
eEast = 0
eWest = 0
eUp = 0
eDown = 0
eNE = 0
eNW = 0
eSE = 0
eSW = 0
la north
bl
~l @lastDir
#T+ ending
triggers are
Exits: 1%.
a = 1
b = %numwords( %1)
eNorth = 0
eSouth = 0
eEast = 0
eWest = 0
eUp = 0
eDown = 0
eSW = 0
eSE = 0
eNE = 0
eNW = 0
#T- rName
#T- blah133
#T- ending
#WHILE (@A <= @B) {
#IF (%word( %1, @A) = "south") {
eSouth = 1
hSouth = 0
} {}
#IF (%word( %1, @A) = "north") {
eNorth = 1
hNorth = 0
} {}
#IF (%word( %1, @A) = "east") {
eEast = 1
hEast = 0
} {}
#IF (%word( %1, @A) = "west") {
eWest = 1
hWest = 0
} {}
#IF (%word( %1, @A) = "up") {
eUp = 1
hUp = 0
} {}
#IF (%word( %1, @A) = "down") {
eDown = 1
hDown = 0
} {}
#IF (%word( %1, @A) = "southeast") {
eSE = 1
hSE = 0
} {}
#IF (%word( %1, @A) = "southwest") {
eSW = 1
hSW = 0
} {}
#IF (%word( %1, @A) = "northeast") {
eNE = 1
hNE = 0
} {}
#IF (%word( %1, @A) = "northwest") {
eNW = 1
hNW = 0
} {}
#ADD A 1
}
#IF (@hSouth = 1) {#SAY Hidden Exit: South} {}
#IF (@hNorth = 1) {#SAY Hidden Exit: North} {}
#IF (@hEast = 1) {#SAY Hidden Exit: East} {}
#IF (@hWest = 1) {#SAY Hidden Exit: West} {}
#IF (@hUp = 1) {#SAY Hidden Exit: Up} {}
#IF (@hDown = 1) {#SAY Hidden Exit: Down} {}
#IF (@hSW = 1) {#SAY Hidden Exit: Southwest} {}
#IF (@hSE = 1) {#SAY Hidden Exit: Southeast} {}
#IF (@hNW = 1) {#SAY Hidden Exit: Northwest} {}
#IF (@hNE = 1) {#SAY Hidden Exit: Northeast} {}
~>~>-
#T- rName
#IF (@lastDir = "north") {hNorth = 1} {}
#IF (@lastDir = "south") {hSouth = 1} {}
#IF (@lastDir = "east") {hEast = 1} {}
#IF (@lastDir = "west") {hWest = 1} {}
#IF (@lastDir = "up") {hUp = 1} {}
#IF (@lastDir = "down") {hDown = 1} {}
#IF (@lastDir = "northwest") {hNW = 1} {}
#IF (@lastDir = "northeast") {hNE = 1} {}
#IF (@lastDir = "southwest") {hSW = 1} {}
#IF (@lastDir = "southeast") {hSE = 1} {}
No such board.
#T- blah133
#IF (@lastDir = "north") {la south} {
#IF (@lastDir = "south") {la east} {
#IF (@lastDir = "east") {la west} {
#IF (@lastDir = "west") {la up} {
#IF (@lastDir = "up") {la down} {
#IF (@lastDir = "down") {la northeast} {
#IF (@lastDir = "northeast") {la northwest} {
#IF (@lastDir = "northwest") {la southeast} {
#IF (@lastDir = "southeast") {la southwest} {
#IF (@lastDir = "southwest") {
#T+ ending
look
} {}
}
}
}
}
}
}
}
}
} |
|
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Mon Sep 06, 2010 1:24 am |
The first commands in both the Rname and blah133 triggers are #T- Rname and #T- blah133, respectively. Even if this is unrelated to the reason for your posts, this should not ever be the case.
EDIT: this script would make a nice candidate to learn by example via rebuilding it. Unlike your IMM (feel free to bonk him on the head), you should probably use meaningful names for aliases and variables so you can keep track of what's what while you're learning. Also, because you are learning, feel free to explore the helpfile and don't be afraid to experiment with different commands/functions. The IMM who wrote this seems to be doing a few things a bit on the "wrong/could be done better" side, which would be another good incentive to learn with. |
|
_________________ EDIT: I didn't like my old signature |
|
|
 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|