mIRC Home    About    Download    Register    News    Help

Print Thread
#255061 18/09/15 07:38 AM
Joined: Sep 2015
Posts: 6
G
Gustav Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
G
Joined: Sep 2015
Posts: 6
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

Joined: Dec 2014
Posts: 68
M
Babel fish
Offline
Babel fish
M
Joined: Dec 2014
Posts: 68
Here's a simple option :P


Code:
on *:text:*:#: { 
  if ($nick == michalukz) {
    msg $chan /me Hi, This is yodelling!
  }
  else {
    return
  }
}

Joined: Dec 2014
Posts: 68
M
Babel fish
Offline
Babel fish
M
Joined: Dec 2014
Posts: 68
Tested and it does work fine smile

Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
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

Joined: Sep 2015
Posts: 6
G
Gustav Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
G
Joined: Sep 2015
Posts: 6
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
    }
}



Last edited by Gustav; 19/09/15 02:32 AM.
Joined: Sep 2015
Posts: 6
G
Gustav Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
G
Joined: Sep 2015
Posts: 6
Originally Posted By: Gustav
Gia na valw elegxo ....

To'kana monos mou telika laugh
Code:
on *:text:*:#:{
  if ($me isin $1-)   {
          ....
  }

Last edited by Gustav; 19/09/15 02:32 AM.
Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
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))

Joined: Sep 2015
Posts: 1
S
Mostly harmless
Offline
Mostly harmless
S
Joined: Sep 2015
Posts: 1
thanks for your nice share smile i will try it in my server

Joined: Feb 2015
Posts: 7
B
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
B
Joined: Feb 2015
Posts: 7
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

Last edited by BigLamer; 25/09/15 04:10 AM.
Joined: Sep 2015
Posts: 6
G
Gustav Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
G
Joined: Sep 2015
Posts: 6
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?

Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
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



Last edited by OrFeAsGr; 28/09/15 01:55 PM.

Link Copied to Clipboard