|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
OP
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Ok, I am baffled by what should be very simple... I'm sending data between two users from one dialog to the other. Here is the code that is in my CTCP event:
elseif ($2 == deny) {
if ($did(Scattergories,$3) != DUPE) { did -ra Scattergories $3 DENIED | scoresda $3 }
}
elseif ($2 == accept) {
if ($did(Scattergories,$3) != DUPE) { did -ra Scattergories 0 pts. | scoresda $3 }
}
The user sending the data sends: /ctcp $nick scattergories deny ID The ID is the dialog ID being used. The receiver gets, for example: SENDINGNICK SCATTERGORIES DENY 47 or SENDINGNICK SCATTERGORIES ACCEPT 47 When I put echo in front of the /did event, it echos it correctly, so I know I'm getting the correct data. However, this doesn't update the dialog with the /did command. If I type the command on the command line (exactly as it echos if I put echo in front of the command), it works. Any ideas? And, yes, I'm writing a Scattergories game... it's almost completed, other than some end game bugs I'm trying to work out, like this oen. ------ Another weird problem I am having is here:
if ($did(Scattergories,$calc(58 + %c)) == $did(Scattergories,$calc(%c - 2))) {
did -ra Scattergories $calc(38 + %c) DUPE
did -ra Scattergories $calc(78 + %c) DUPE
}
Basically, this will mark any answers that are in both yours and your opponent's sections as being duplicates. It works just fine, except one problem. Here's the dialog setup:
Q1 YourAnswer YourScore OpponentAnswer OpponentScore
Q2 YourAnswer YourScore OpponentAnswer OpponentScore
Q3 YourAnswer YourScore OpponentAnswer OpponentScore
...and so on. If the duplicate is in any question except Q1, it works... it places DUPE in the scores sections of both players. However, in Q1, it will only place DUPE in your score section... not in the opponent's score section. Looking at the code, I have no idea how this is possible unless the secont /did has lost the value somehow and has a null value for %c or something. Even then, I'd expect an error. %c is a loop starting at 3 and going to 14. The score IDs for your score are 41 to 52. For the opponent, they are 81 to 92. Thoughts? Ideas? Thanks.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
Im not really sure why it doesnt change any text mainly becuase i havent ever needed to do jack with dialogs, so havent studied there behavour much. However is it that the dialogs visual might not be being updated, what happens to the values if you say pass another window infront of it, and then remove that? If it realy realy hasnt updated, and your /echo in front seems to produce valid values try this... (1) add this line alias -l DID { echo -st DID $1- | DID $1- }(2) place a halt directly following the did -ra Scattergories command This well sometimes yield interestinly differing results than a /echo One noticable example is... command>//echo -s CHECK CMD > //SET %what 12 result>CHECK CMD > //SET 12 now using alias -l SET { echo -s CHECK CMD > SET $1- | SET $1- } simply command>//SET %what 12 result>CHECK CMD > SET %what 12 ** dont know if any of that helped but there ya go ** One last thing if it is something really untracable, as i dont see it, it might be worth forcing evaluation order so the DID command gets the resulting litteral texts, ie: use [ ] areound the $n's On the other problem,. id check ther dialog table incase u numbered something wrong.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
OP
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
I'll try that suggestion later on. And, it's not a matter of not being updated, unfortunately. Here's that section of the dialog:
;OpponentScore
text "",81,305 11 19 10, right
text "",82,305 21 19 10, right
text "",83,305 31 19 10, right
text "",84,305 41 19 10, right
text "",85,305 51 19 10, right
text "",86,305 61 19 10, right
text "",87,305 71 19 10, right
text "",88,305 81 19 10, right
text "",89,305 91 19 10, right
text "",90,305 101 19 10, right
text "",91,305 111 19 10, right
text "",92,305 121 19 10, right
text "Total: 0 pts.",93,273 131 51 8,right
So, it's labeled properly. ID 81 just isn't updated. Oh well, I'll keep looking.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Jul 2003
Posts: 655
Fjord artisan
|
Fjord artisan
Joined: Jul 2003
Posts: 655 |
from what i understand of your code, the following if fails if %c = 3
if ($did(Scattergories,$calc(58 + %c)) == $did(Scattergories,$calc(%c - 2))) {
so id's 61 and 1 are somehow not the same causing id 81 to not be updated, maybe check that these two dialog id's are infact the right text boxes?
does id 41 update correctly? (to confirm weather or not the if statement is returning true or false)
"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
OP
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Hm... I think I'm looking at an old copy of my script since I made updates at home. I'll have to look. I think I actually did change the (%c - 3) to (%c + 18). I pretty much would have had to... ID 41 does change to DUPE. That's why this confuses me so much. If one works, the other should.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Jul 2003
Posts: 655
Fjord artisan
|
Fjord artisan
Joined: Jul 2003
Posts: 655 |
Hmm, what if you combine the did command.
if ($did(Scattergories,$calc(58 + %c)) == $did(Scattergories,$calc(%c - 2))) { did -ra Scattergories $+($calc(38 + %c),$chr(44),$calc(78 + %c)) DUPE }
"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
OP
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Yeah, I'll try that. I had considered that once in another part of the script and chose not to in order to keep it easier to understand and read. Still, it would be worth trying.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Jul 2003
Posts: 655
Fjord artisan
|
Fjord artisan
Joined: Jul 2003
Posts: 655 |
Indeed, i didn't create a table for testing, but from the dialog id's and code you pasted i can't think of a single thing that would be stopping it. (unless you have an event for that id that halts it)
"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
|
|
|
|
|