mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2010
Posts: 969
F
Hoopy frood
OP Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
I'm on a server that does not send user-state events (JOIN, PART, MODE, NAMES list) as a result of the host catering to a web/browser interface. Instead, they send user-state related information as an ircv3 message-tag with each relevant event. As such scripters are not able to supply backwards compatibility for older scripts without manually altering those scripts.

So to alleviate that, I'd like to see a way to altar/spoof a user's channel modes for the duration that the event is being processed:

/spoofmode <+|-modes>

Event must originate from a user
Event must target a channel
Event must be prefixed with ^

Code
;; received event:
;;   @user-channel-flags=ov :User!ident@addr PRIVMSG #chan :I'm an op and voiced

on ^*:TEXT:*:#chan:{
  ;; could also be done together
  ;; /spoofmode $chan $nick +ov

  if (o isincs $msgtags(user-channel-flags).key) {
    spoofmode +o
  }
  if (v isincs $msgtags(user-channel-flags).key) {
    spoofmode +v
  }
  
  ;; user is now considered as being op'ed and voiced for scripting purposes

  ;; remove voice for demo purposes
  spoofmode -v

}

on *:TEXT:!command:#chan:{
  if ($nick isop #chan) {
    ;; this would be valid
  }
}


As an aside, modes can be spoofed with parseline but the modes are forgotten as soon as the line is processed as there is no persistent nicklist for the server.


I am SReject
My Stuff
Joined: Apr 2010
Posts: 969
F
Hoopy frood
OP Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
I messed up the example slightly, and since I can't edit the OP, here is a fixed simplified version

Code
;; received event:
;;   @user-channel-flags=ov :User!ident@addr PRIVMSG #chan :!command

on ^*:TEXT:*:#chan:{
  if (o isincs $msgtags(user-channel-flags).key) {
    spoofmode +o
  }
}

on *:TEXT:!command:#chan:{
  if ($nick isop #chan) {
    ;; this would be valid
  }
}


I am SReject
My Stuff

Link Copied to Clipboard