mIRC Homepage

[Help]Integrate a Leave Of Absence trigger

Posted By: SophisDecay

[Help]Integrate a Leave Of Absence trigger - 27/10/14 11:25 PM

Ok so this is a snippet of the working code.

****************Working****************

on *:text:!stats*:#: {
if (%account [ $+ [ $nick ] ] == on) && ($2 == $null) {
/msg $chan 8,17Your Stats8 7Name:15 %name [ $+ [ $nick ] ] 87Health:15 %health [ $+ [ $nick ] ] 87Thirst:15 %thirst [ $+ [ $nick ] ] 87Age:15 %age [ $+ [ $nick ] ] 87Rank:15 %rank [ $+ [ $nick ] ]
}
elseif (%account [ $+ [ $nick ] ] == on) && ($2 != $null) {
/msg $chan 8,17 $2 $+ 's Stats8,1 7Name:15 %name [ $+ [ $2 ] ] 87Health:15 %health [ $+ [ $2 ] ] 87Thirst:15 %thirst [ $+ [ $2 ] ] 87Age:15 %age [ $+ [ $2 ] ] 87Rank:15 %rank [ $+ [ $2 ] ]
}

************endworking**********

Now this is the snippet of what i'm trying to integrate into the above snippet.

*******************WIP***********************
else (%member [ $+ [ $nick ] ] == on) && ($2 == (%account [ $+ [ $nick ] ] == off) {
/msg $chan Sorry $nick $2 is on LOA, they set themself to LOA on %LOATIME [ $+ [ $nick ] ]
}
}
ON *:text:!LOA:#: {
if (%account [ $+ [ $nick ] ] == on) {
set %account [ $+ [ $nick ] ] off
set %LOA [ $+ [ $nick ] ] ON
set %LOATIME [ $+ [ $nick ] ] $asctime
/msg $chan $nick is now set to LOA.
}
}

ON *:text:!LOAreturn:#: {
if (%account [ $+ [ $nick ] ] == off) {
set %account [ $+ [ $nick ] ] on
set %LOA [ $+ [ $nick ] ] OFF
del %LOATIME [ $+ [ $nick ] ]
/msg $chan $nick has returned from LOA.
}
}
****************endWIP******************

Any help would be nice, when I test the bot and set myself to !LOA it tells me myself and everyone is LOA... but everyone else can see my stats and still see each others

Thank you!
Posted By: Wims

Re: [Help]Integrate a Leave Of Absence trigger - 28/10/14 12:43 AM

Code:
on *:text:*:#:{
  if ($1 == !stats) {
    if (%account [ $+ [ $nick ] ] == on) {
      if ($2 == $null) {
        /msg $chan 8,17Your Stats8 7Name:15 %name [ $+ [ $nick ] ] 87Health:15 %health [ $+ [ $nick ] ] 87Thirst:15 %thirst [ $+ [ $nick ] ] 87Age:15 %age [ $+ [ $nick ] ] 87Rank:15 %rank [ $+ [ $nick ] ]
      }
      else {
        /msg $chan 8,17 $2 $+ 's Stats8,1 7Name:15 %name [ $+ [ $2 ] ] 87Health:15 %health [ $+ [ $2 ] ] 87Thirst:15 %thirst [ $+ [ $2 ] ] 87Age:15 %age [ $+ [ $2 ] ] 87Rank:15 %rank [ $+ [ $2 ] ]
      }
    }
    elseif ($v1 == off) /msg $chan Sorry $nick $2 is on LOA, they set themself to LOA on %LOATIME [ $+ [ $nick ] ]
  }
  elseif ($1 == !LOA) {
    if (%account [ $+ [ $nick ] ] == on) {
      set %account [ $+ [ $nick ] ] off
      set %LOA [ $+ [ $nick ] ] ON
      set %LOATIME [ $+ [ $nick ] ] $asctime
      msg $chan $nick is now set to LOA.
    }
  }
  elseif ($1 == !LOAreturn) {
    if (%account [ $+ [ $nick ] ] == off) {
      set %account [ $+ [ $nick ] ] on
      set %LOA [ $+ [ $nick ] ] OFF
      unset %LOATIME [ $+ [ $nick ] ]
      msg $chan $nick has returned from LOA.
    }
  }
}
Try this
Posted By: SophisDecay

Re: [Help]Integrate a Leave Of Absence trigger - 28/10/14 12:52 AM

Its causing some kind of conflict
I'm chisu

19:51] Chisu !LOA
[19:51] NeverMore` Chisu is now set to LOA.
[19:51] Chisu !stats
[19:51] NeverMore` Sorry Chisu is on LOA, they set themself to LOA on Mon Oct 27 19:51:24 2014
[19:51] Chisu !stats Barra
[19:51] NeverMore` Sorry Chisu Barra is on LOA, they set themself to LOA on Mon Oct 27 19:51:24 2014
Posted By: Wims

Re: [Help]Integrate a Leave Of Absence trigger - 28/10/14 01:55 AM

Code:
on *:text:*:#:{
var %nick $eval($+(%,account,$nick),2), %2 $eval($+(%,account,$2),2)
  if ($1 == !stats) {
    if (%nick == on) {
      if ($2 == $null) {
        msg $chan 8,17Your Stats8 7Name:15 %name [ $+ [ $nick ] ] 87Health:15 %health [ $+ [ $nick ] ] 87Thirst:15 %thirst [ $+ [ $nick ] ] 87Age:15 %age [ $+ [ $nick ] ] 87Rank:15 %rank [ $+ [ $nick ] ]
      }
      elseif (%2 == off) /msg $chan Sorry $nick $2 is on LOA, they set themself to LOA on %LOATIME [ $+ [ $2 ] ]
      elseif (%2 == on) /msg $chan 8,17 $2 $+ 's Stats8,1 7Name:15 %name [ $+ [ $2 ] ] 87Health:15 %health [ $+ [ $2 ] ] 87Thirst:15 %thirst [ $+ [ $2 ] ] 87Age:15 %age [ $+ [ $2 ] ] 87Rank:15 %rank [ $+ [ $2 ] ]
      }
    }
  }
  elseif ($1 == !LOA) {
    if (%account [ $+ [ $nick ] ] == on) {
      set %account [ $+ [ $nick ] ] off
      set %LOA [ $+ [ $nick ] ] ON
      set %LOATIME [ $+ [ $nick ] ] $asctime
      msg $chan $nick is now set to LOA.
    }
  }
  elseif ($1 == !LOAreturn) {
    if (%account [ $+ [ $nick ] ] == off) {
      set %account [ $+ [ $nick ] ] on
      set %LOA [ $+ [ $nick ] ] OFF
      unset %LOATIME [ $+ [ $nick ] ]
      msg $chan $nick has returned from LOA.
    }
  }
}
Posted By: SophisDecay

Re: [Help]Integrate a Leave Of Absence trigger - 29/10/14 02:18 AM

OH Thank you! I just changed
This..
if (%nick == on) {
To this
if (%Member [ $+ [ $nick ] ] == on) {

It works perfectly, Thank you so very much!!
© 2021 mIRC Discussion Forums