mIRC Homepage
Posted By: Gustav action based on nickname - 18/09/15 07:38 AM
So i have this script running:
Code:
on *:action:$($+(*,slap,*,$me,*)):*:{
  do something
}


I need to edit this based on my nickname.
Since i run mirc through my webserver and i change my nick if i'm connected to it or not, i need a check routine for my nickname to do something different.
Code:
on *:action:$($+(*,slap,*,$me,*)):*:{
  if ($me.nick == away_nickname){
    do something
  } else {
   do something else
  }


Could someone help me on this since i'm new on this ? crazy
Posted By: michaelukz Re: action based on nickname - 18/09/15 08:38 AM
Here's a simple option :P


Code:
on *:text:*:#: { 
  if ($nick == michalukz) {
    msg $chan /me Hi, This is yodelling!
  }
  else {
    return
  }
}
Posted By: michaelukz Re: action based on nickname - 18/09/15 08:40 AM
Tested and it does work fine smile
Posted By: OrFeAsGr Re: action based on nickname - 18/09/15 12:31 PM
Your code is almost right!
Code:
on *:action:*:*:{
if ($+(*,slap*,$me,*) iswm $1-) {
  if ($me == away_nickname){
    do something
  } 
else {
   do something else
  }
}
}

This should do it! smile
Posted By: Gustav Re: action based on nickname - 19/09/15 01:31 AM
Originally Posted By: OrFeAsGr
Your code is almost right!
Code:
on *:action:*:*:{
if ($+(*,slap*,$me,*) iswm $1-) {
  if ($me == away_nickname){
    do something
  } 
else {
   do something else
  }
}
}

This should do it! smile

The above code worked just fine.
Aderfe orfea s'euxaristw poli.
Gia na valw elegxo, text mention to nick mou, na kanei kati, pws tha to montarw?
Code:
on *:text:*:*:{
  if ($+(*,lekseis,lekseis,*) iswm $1-) {
          ;lekseis  i  $lekseis?
    if ($me == nickname)   {
        kane_kati
    }
}


Posted By: Gustav Re: action based on nickname - 19/09/15 02:31 AM
Originally Posted By: Gustav
Gia na valw elegxo ....

To'kana monos mou telika laugh
Code:
on *:text:*:#:{
  if ($me isin $1-)   {
          ....
  }
Posted By: OrFeAsGr Re: action based on nickname - 19/09/15 08:20 PM
auto pou sou dwsa vale apla allakse to on *:action:*:#: { se on *:text:*:#: {
(for those who might didnt understand this is Greeklish :P( Greek with English letters.. long story :P))
Posted By: sempatick Re: action based on nickname - 20/09/15 12:30 AM
thanks for your nice share smile i will try it in my server
Posted By: BigLamer Re: action based on nickname - 25/09/15 04:08 AM
you should add flood protection to stop script running when reached lines per time period

Code:
ON ^*:ACTION:*:#:{
  if ($me isin $1-) && ($nick != $me) {
    inc -eu10 %temp_num_ $+ $nick
    if ($nick ison $chan) && ($var($+(%,temp_num_,$nick),1).value < 6) {
      var %tmp_slap_reason $read(scripts/slaps.txt)
      .describe $chan %tmp_slap_reason
......


or something like that


Originally Posted By: OrFeAsGr
auto pou sou dwsa vale apla allakse to on *:action:*:#: { se on *:text:*:#: {
(for those who might didnt understand this is Greeklish :P( Greek with English letters.. long story :P))


Same as our Bulgarian shliokavica:
makar da e otvratitelno, pomaga ot vreme na vreme:D
Posted By: Gustav Re: action based on nickname - 27/09/15 05:39 PM
So i have this code running on connect:
Code:
on *:CONNECT:{ 
  if $network == quakenet {
    .timer 1 1 .msg q@cserve.quakenet.org AUTH %myauth $$?*
    mode $me +x
    j #channel1
    j #channel2
    j #channel3
    ...
    j #channeln
  }
}


I need to modify it by adding an auth check BEFORE joins.
I thought of adding a timer with infinite loops and interval 5 seconds.
On each pulse i will check my address and if i'm authed Then i will join

What i've got so far:
Code:
on *:CONNECT: {
  if $network == quakenet {
    .timer 1 1 .msg q@cserve.quakenet.org AUTH %myauth $$?*
    mode $me +x

    .timer 0 2 {

      if $remove($mid($address($me,2),4,99),@,.users.quakenet.org) != %mynick {
        msg script-bot not authed
        inc %trash
        dec %trash
      }

      else {
        msg script-bot authed
        ;j #channel_1
        ;j #channel_2
        ;j #channel_3
        ;...
        ;j #channel_n
        .timer off
        break
      }

    }

  }

}


What am i doing wrong and i can't get it to work?
Posted By: OrFeAsGr Re: action based on nickname - 28/09/15 01:51 PM
Code:
;You have to use an alias cause the timer doesn't work that way.
alias checkauth {
if ($remove($mid($address($me,2),4,99),@,.users.quakenet.org) != $me) {
return not authed
}
elseif ($remove($mid($address($me,2),4,99),@,.users.quakenet.org) == $me) {
return Authed
}
}

on *:connect: {
if ($network == quakenet) {
.timer 1 1 .msg q@cserve.quakenet.org AUTH %myauth $$?*
mode $me +x
if ($checkauth == not authed) {
msg script-bot $v1
.msg q@cserve.quakenet.org AUTH %myauth $$?*
}
elseif ($checkauth == authed) {
msg script-bot $v1
;join channels here 
}
}
}


This should work.
If you need more or it doesn't work let me know! smile


© mIRC Discussion Forums