@program num.muf 1 1000 d i lvar param lvar num $include $lib/alynna $def CONNECT-TIME command @ "Queued event." smatch : main var socket var data var sockstat var forumname var membernum var panum var postcount var status command @ "Queued event." smatch if me @ "G" flag? if exit then 3 sleep me @ "@!" getprop not if { "^BRED^^YELLOW^Your member number is not current! To make it current (and remove this message)" }tell { "^BRED^^YELLOW^use the command 'num '. If you have not been to the " }tell { "^BRED^^YELLOW^forums, please visit http://www.masterzdm.com/NCD/postlist.php?Board=ENTER " }tell { "^BRED^^YELLOW^and sign up at http://www.masterzdm.com/NCD/newuser.php " }tell { "^BRED^^YELLOW^To disable this message without getting a forum #, type num -1. Your access " }tell { "^BRED^^YELLOW^to certain places on the MUCK may be limited as a result. " }tell exit else me @ "@!" getprop -1 = if exit then me @ "@#" getpropstr param ! { "Doing connect-time profile update, you can do this manually with the 'update' command..." }tell then else param ! param @ not if me @ "@#" getpropstr param ! then then param @ "-1" smatch if me @ "@!" -1 setprop me @ "@#" 0 setprop me @ "@ForumName" 0 setprop me @ "@PostCount" 0 setprop me @ "@Authorization" 0 setprop me @ "@PA" 0 setprop me @ "!AVATAR" set { "You've been set as a non-avatar. You may change this later by using the 'num' command after you establish a forum member number." }tell exit then me @ "@!" getprop 1 = if me @ "@#" getprop param ! then param @ atoi if "0000" param @ strcat dup strlen 4 - strcut swap pop num ! else { "Your member number was unset and your avatar mark removed." }tell me @ "@#" 0 setprop me @ "!AVATAR" set exit then CONNECT-TIME not if { "Connecting to 'http://www.masterzdm.com/NCD/showprofile.php?User=" num @ "' ..." }tell then "www.masterzdm.com" 80 sockopen sockstat ! socket ! sockstat @ "noerr" smatch if CONNECT-TIME not if { "Connected, making the request ..." }tell then 0 sleep socket @ { "GET http://www.masterzdm.com/NCD/showprofile.php?User=" num @ }cat socksend pop else { "Failed to connect!" }tell then CONNECT-TIME not if { "Searching for profile information ..." }tell then begin socket @ nbsockrecv strip data ! sockstat ! ( ) ( data @ if { data @ }tell then ) sockstat @ not if break then data @ "" subst "/" explode pop forumname ! toint membernum ! toint panum ! toint postcount ! toint status ! break then repeat socket @ sockclose pop command @ "Queued event." smatch if membernum @ if { "Found member number " membernum @ ": " me @ ansi_unparseobj "^NORMAL^; ^GREEN^" forumname @ "^NORMAL^; ^CYAN^" panum @ 0 < if "No PA#" else "PA#" panum @ then "^NORMAL^; ^YELLOW^" postcount @ " posts^NORMAL^; " status @ case -1 = when "^RED^Banned." end 0 = when "^YELLOW^Unauthorized." end 1 = when "^GREEN^Authorized." end endcase }tell else { "Member number " membernum @ " not found." }tell exit then else membernum @ if { "Found member number " membernum @ }tell { "Forum name:" 20 lj forumname @ }tell { "Forum number:" 20 lj membernum @ }tell { "PA Number:" 20 lj panum @ 0 < if "None" else panum @ then }tell { "Post count:" 20 lj postcount @ }tell { "Authorization:" 20 lj status @ case -1 = when "Banned" end 0 = when "Unauthorized" end 1 = when "Authorized" end endcase }tell else { "Member number " membernum @ " not found." }tell exit then then me @ "@!" getprop 1 < if { "Type YES in all caps to certify and set this information on you." }tell { "Anything else will abort this operation." }tell { "Please note that setting a forum number on yourself that is not really yours" }tell { "can result in abrupt character removal or other administrative discipline." }tell { " " }tell { "Do you hereby certify that the above forum ID is yours?" }tell read "YES" smatch if me @ "@#" "0000" membernum @ intostr strcat dup strlen 4 - strcut swap pop setprop me @ "@ForumName" forumname @ setprop me @ "@PostCount" postcount @ setprop me @ "@Authorization" status @ setprop status @ 0 > if me @ "AVATAR" set else me @ "!AVATAR" set then panum @ 0 >= if me @ "@PA" "000" panum @ intostr strcat dup strlen 3 - strcut swap pop setprop then me @ "@!" 1 setprop { "All information was set!" }tell else me @ "@#" 0 setprop me @ "@ForumName" 0 setprop me @ "@PostCount" 0 setprop me @ "@Authorization" 0 setprop me @ "@PA" 0 setprop me @ "@!" 0 setprop me @ "!AVATAR" set { "All information was UNset!" }tell then else me @ "@#" "0000" membernum @ intostr strcat dup strlen 4 - strcut swap pop setprop me @ "@ForumName" forumname @ setprop me @ "@PostCount" postcount @ setprop me @ "@Authorization" status @ setprop status @ 0 > if me @ "AVATAR" set else me @ "!AVATAR" set then panum @ 0 >= if me @ "@PA" "000" panum @ intostr strcat dup strlen 3 - strcut swap pop setprop then me @ "@!" 1 setprop CONNECT-TIME not if { "Information was updated!" }tell then then ; . c q