Myrddin's +bbnew on MUX
-
Has anyone adjusted Myrddin's +bbnext to work on MUX? The bboards in general work great (we're on MUX 2.12.0.2), but for some reason +bbnext keeps giving us trouble. Which is not dire so much as aggravating. Basically it doesn't seem to check properly if people have unread posts and just tells you there's nothing new to read even when there is. We tried adjusting, but the best we got was that it would give you your first unread post and then forget about any others.
$+bbnew:@switch setdiff(iter(setr(0,u(#35/VALID_GROUPS,%#,read)),get(##/MESS_LST)),setr(1,get(%#/BB_READ)))=,think pemit(%#,There are no more bulletin board posts to read.),@fo %#=+bbread [iter(revwords(%q0),switch(setr(2,setdiff(setr(3,get(##/MESS_LST)),%q1)),,,setq(4,##)))][setq(2,setdiff(setr(3,get(%q4/MESS_LST)),%q1))][setq(1,first(sort(iter(%q2,member(%q3,##)))))][name(%q4)]/%q1
Any idle help would be adored.
-
Are we looking at +bbnew or +bbnext? because bbnew seems to work ok, and if we're talking about bbnext, might wanna change the title.
Edit: Nevermind, I can look at the code. Duh.
-
Is the intention of +bbnew to spam out all unread bbposts?
-
It shows you the first unread bbpost on the list of undreads, yeah. I use it religiously.
-
I am not on mux so can't help too much, but can you possibly provide debug spam? I would be happy to look through it and pinpoint issues.
Perhaps use gist
-
Roz told me to stop making her post and come post myself, so:
- The +bbnext that she linked above which we were trying to use doesn't work.
- The +bbnew I told her to paste works fine now once I put the right numbers in.
Maybe.
Sometimes we've run into some weird issues as she described, but I can't reproduce it at the moment.
So, as Roz would say: ¯\(ツ)/¯
-
It's a really trivial fix, IIRC. I fixed it on KAW.
- Use @find to find the BBPocket object.
- Type &bbpocket [DB # of your bulletin boards] = [[DB # of the bbpocket].
- Great success.
These working commands are making reference to your bbpocket object by just using the DBREF# of bbpocket, but +bbnew doesn't have that. If you read it, it instead says v(bbpocket). You probably don't actually have an attribute called "bbpocket".
So, look at your BB Global and see stuff like CMD_+BBPOST-POST, see how there's a dbref in stuff like .. .
$+bbpost:@switch [hasattr(#159,bb_post_hdr_%#)]:[hasattr(#159,bb_post_bdy_%#)]=0:0,{@pemit %#=You do not have a bbpost in progress.},1:0,{@pemit %#=Your post is empty. Please add text with the '+bbwrite <text>' command or discard the posting with the '+bbtoss' command.},{&mess_lst...
But +bbnew (and the other bbnew command, as there are two), have:
CMD.BBNEW [#3]: $+bbnew:think [setr(0,first(iter(u([v(bbpocket)]/valid_groups,%#,read),switch(trim(u([v(bbpocket)]/unreadnums,%#,##)),,,##))))];@switch [words(r(0))]=0,@pemit %#=No unread messages on any board....
What's going on here is that it's looking for an attribute named "bbpocket" which does not actually exist. The easiest fix is to just give it that attribute.
Another fix is to manually put in the numbers for BBPocket.
A third fix is to turn v(bbopcket) into just bbpocket so anything that says "u(v(bbpocket)/blahblahblah) says u(bbpocket/blahblahblah), this would need BBPocket to be located inside or in the same room as BB global.
@Tez If you fixed it by replacing all the numbers, there are two commands to fix, &CMD.BBNEW and &CMD.BBNEW-BOARD. Maybe the issues that come up only sometimes are if you have only fixed one of the two.
If it doesn't work, just, paste this in there, but make sure &bbpocket exists on your BB Global:
&cmd.Bbnew BBDBREF= $+bbnew *:@switch member(u([v(bbpocket)]/valid_groups,%#,read),setr(0,u([v(bbpocket)]/get_group,setr(2,first(%0,/)))))=0,{@pemit %#=[switch(%q0,#-2,That group name is not specific enough.,You do not subscribe to that group.)]},{think [setq(4,member(get([v(bbpocket)]/groups),%q0))][setq(5,first(iter(u([v(bbpocket)]/unreadnums,%#,%q0),switch(gte(##,after(%0,/)),1,##))))];@switch [and(lte(%q5,words(get(%q0/MESS_LST))),isnum(%q5))]=0,{@pemit %#=No new messages beyond %q4/[setr(6,add(after(%0,/),0))] ([name(%q0)]/%q6).},{@pemit %#=[center(= [name(%q0)] =,78,=)]%r[ljust(Message: %q4/%q5[switch(u([v(bbpocket)]/fn_timeout_close,index(setr(3,get(%q0/HDR_[extract(get(%q0/MESS_LST),%q5,1)])),|,5,1)),1,{%b(timeout warning)})],35)]Posted[space(8)]Author%r[ljust(index(%q3,|,1,1),35)][ljust(index(%q3,|,2,1),14)][mid([index(%q3,|,3,1)][ifelse(and(hasattr(%q0,anonymous),hasflag(%#,wizard)),%b\([name(index(%q3,|,4,1))]\),)],0,29)]%r[repeat(-,78)]%r[get(%q0/BDY_[extract(get(%q0/MESS_LST),%q5,1)])]%r[repeat(=,78)]; &bb_read %#=[setunion(get(%#/bb_read),[extract(get(%q0/MESS_LST),%q5,1)])]}}; @wait 2={&bb_read %#=[setinter(get(%#/bb_read),get([v(bbpocket)]/master_lst))]}}}} &Cmd.BBNew-Board BBDBREF = $+bbnew *:@switch member(u([v(bbpocket)]/valid_groups,%#,read),setr(0,u([v(bbpocket)]/get_group,setr(2,first(%0,/)))))=0,{@pemit %#=[switch(%q0,#-2,That group name is not specific enough.,You do not subscribe to that group.)]},{think [setq(4,member(get([v(bbpocket)]/groups),%q0))][setq(5,first(iter(u([v(bbpocket)]/unreadnums,%#,%q0),switch(gte(##,after(%0,/)),1,##))))];@switch [and(lte(%q5,words(get(%q0/MESS_LST))),isnum(%q5))]=0,{@pemit %#=No new messages beyond %q4/[setr(6,add(after(%0,/),0))] ([name(%q0)]/%q6).},{@pemit %#=[center(= [name(%q0)] =,78,=)]%r[ljust(Message: %q4/%q5[switch(u([v(bbpocket)]/fn_timeout_close,index(setr(3,get(%q0/HDR_[extract(get(%q0/MESS_LST),%q5,1)])),|,5,1)),1,{%b(timeout warning)})],35)]Posted[space(8)]Author%r[ljust(index(%q3,|,1,1),35)][ljust(index(%q3,|,2,1),14)][mid([index(%q3,|,3,1)][ifelse(and(hasattr(%q0,anonymous),hasflag(%#,wizard)),%b\([name(index(%q3,|,4,1))]\),)],0,29)]%r[repeat(-,78)]%r[get(%q0/BDY_[extract(get(%q0/MESS_LST),%q5,1)])]%r[repeat(=,78)]; &bb_read %#=[setunion(get(%#/bb_read),[extract(get(%q0/MESS_LST),%q5,1)])]}}; @wait 2={&bb_read %#=[setinter(get(%#/bb_read),get([v(bbpocket)]/master_lst))]}}}}
-
That's pretty much what I've done: I swapped the dbrefs around on the +bbnew command I had her paste above, and we haven't had problems with it. That was def. an easy fix.
The +bbnext command, which is an entirely different command, just didn't work. Period. And it was not an easy fix -- or, who knows, maybe it was, but it was an easy fix that I could not see for the life of me. So I just lifted the +bbnew out of a Penn game running on FS3, switched the numbers, and dropped it in MUX and here we are. Everything has been happy.
So far.
(I feel like I just made all the real coders out there wince but eyyyyy.)
If we have trouble with it again, I'll def. take a look at your commands and slap them in. Thanks, @MrMaker.
-
Hey man, if it works, it works, I ain't gonna judge. Even if something takes he code equivalent of duct tape and baling wire to get somewhere, we aren't testing out for the olympics, right?