All right; more code coming your way.
I've separated each call to read a section into classes and put in a separate function for each. It works this way...or , sorta.
The code is as follows:
CODE
#function {readpublic }
{
#if { "%1" < "%2"}
{
#math {read} {%2 + 1};
#send {readnews public $read}
}
{
#class {public} {kill};
#class {announce} {open};
#send {nstat}
};
}
#function {readannounce}
{
#if { %1 < %2}
{
#math {read} {%2 + 1};
#send {readnews announce $read}
}
{
#class {announce} {kill};
#class {events} {open};
#send {nstat}
};
}
#function {readevents}
{
#if { "%1" < "%2"}
{
#math {read} {%2 + 1};
#send {readnews events $read}
}
{
#class {events} {close};
#send {qq}
};
}
#action {Penned by my hand on the %d%*.} {#send {nstat}}
#action {[Type MORE if you wish to continue reading. (%d\% shown)]} {#send {more}}
#class {announce} {open}
#action {Announce:%sRead%s%d/%d%sarticles.%*} {@readannounce{%3 %4}}
#class {close}
#class {events} {open}
#action {Events:%sRead%s%d/%d%sarticles.%*} {@readevents{%3 %4}}
#class {close}
#class {announce} {close}
#class {events} {close}
#class {public} {open}
#action {Public:%sRead%s%d/%d%sarticles.%*} {@readpublic{%3 %4}}
#class {public} {closs}
Now, there's a few issues with this. And I can't figure out how to make it work the way I need/want it to.
1) Even with the #MATH Variable being updated (or so it says), the VERY next line afterwards to send that number to the mud, sends a literal $read, instead of a variable.
DEBUG:
CODE
[02] math {read} {3081 + 1}
#MATH: VARIABLE {read} HAS BEEN SET TO {3082}.
[02] send {readnews announce $read}
2) The entire nstat is read and parsed at once, Even though I explicitly state for the triggers in the class to read a section, remain CLOSED(disabled)
DEBUG:
CODE
News summary for Rakon:
#DEBUG ACTION {Public:%sRead%s%d/%d%sarticles.%*}
[17] @readpublic{18264 18264}
Public: Read 18264/18264 articles.
#DEBUG ACTION {Announce:%sRead%s%d/%d%sarticles.%*}
[17] @readannounce{3080 3081}
#DEBUG FUNCTION {readannounce}
[10] if { 3080 < 3081}
[02] math {read} {3081 + 1}
#MATH: VARIABLE {read} HAS BEEN SET TO {3082}.
[02] send {readnews announce $read}
[05] endif
[06] else
[05] endif
[17] $result
Announce: Read 3080/3081 articles.
#DEBUG ACTION {Events:%sRead%s%d/%d%sarticles.%*}
[17] @readevents{307 308}
#DEBUG FUNCTION {readevents}
[10] if { "307" < "308"}
[05] endif
[06] else
[02] class {events} {close}
#CLASS {events} IS ALREADY CLOSED.
[02] send {qq}
[05] endif
[17] $result
3)This ends up sending a whole bunch of CRAP to the mud, and not actually doing anything:
DEBUG:
CODE
2298h, 2784m, 10390e, 12820w exdb-
Come again?
2298h, 2784m, 10390e, 12820w exdb-
2298h, 2784m, 10390e, 12820w exdb-
That went right over my head.
2298h, 2784m, 10390e, 12820w exdb-
2298h, 2784m, 10390e, 12820w exdb-
Please restate.
2298h, 2784m, 10390e, 12820w exdb-
2298h, 2784m, 10390e, 12820w exdb-
And even though, I have config command echo on (in TinTin++), NOTHING from that script is shown, from any #send command.
Any ideas for correcting this please?