$modefirst: Difference between revisions

From Scriptwiki
Jump to navigation Jump to search
Aca20031 (talk | contribs)
No edit summary
 
Aca20031 (talk | contribs)
mNo edit summary
Line 7: Line 7:
  on *:[[on voice|VOICE]]:#: {
  on *:[[on voice|VOICE]]:#: {
   [[If-Then-Else|if]] ($modefirst) { [[set]] [[:Category:Variables|%voiced]] [[$vnick]] }
   [[If-Then-Else|if]] ($modefirst) { [[set]] [[:Category:Variables|%voiced]] [[$vnick]] }
   [[If-Then-Else|elseif]] ([[$modelast]]) { echo -atg Users voiced: [[:Category:Variables|%voiced]] }
   [[If-Then-Else|elseif]] ([[$modelast]]) { [[echo]] -atg Users voiced: [[:Category:Variables|%voiced]] }
   [[If-Then-Else|else]] { [[set]] [[:Category:Variables|%voiced]] [[$addtok]]([[:Category:Variables|%voiced]],[[$vnick]],32) }
   [[If-Then-Else|else]] { [[set]] [[:Category:Variables|%voiced]] [[$addtok]]([[:Category:Variables|%voiced]],[[$vnick]],32) }
  }
  }
==See Also==
[[$modelast]]

Revision as of 18:30, 11 May 2008

Returns $true if this is the first mode to trigger in a string of modes. For use in mode events such as On op.

$modefirst

Example

We will make a list of all users voiced by a single mode setting.

on *:VOICE:#: {
  if ($modefirst) { set %voiced $vnick }
  elseif ($modelast) { echo -atg Users voiced: %voiced }
  else { set %voiced $addtok(%voiced,$vnick,32) }
}

See Also

$modelast