mIRC Home    About    Download    Register    News    Help

Print Thread
#124796 11/07/05 02:25 AM
Joined: May 2005
Posts: 106
S
Vogon poet
OP Offline
Vogon poet
S
Joined: May 2005
Posts: 106
i have the following script but it ain't work ing y
Code:
 
on 1:INPUT:#: {
  if (Status !isin $active && $left($1-,1) != /) {
    %chk = $1-
    %chk = $replace(%chk,a,ä)
    %chk = $replace(%chk,b,ß)
    %chk = $replace(%chk,b,ß)
    %chk = $replace(%chk,c,©)
    %chk = $replace(%chk,d,D)
    %chk = $replace(%chk,e,ë)
    %chk = $replace(%chk,f,F)
    %chk = $replace(%chk,g,¶)
    %chk = $replace(%chk,h,h)
    %chk = $replace(%chk,i,í)
    %chk = $replace(%chk,j,j)
    %chk = $replace(%chk,k,k)
    %chk = $replace(%chk,l,£)
    %chk = $replace(%chk,m,m)
    %chk = $replace(%chk,n,ñ)
    %chk = $replace(%chk,o,ó)
    %chk = $replace(%chk,p,P)
    %chk = $replace(%chk,q,q)
    %chk = $replace(%chk,r,®)
    %chk = $replace(%chk,s,¶)
    %chk = $replace(%chk,t,t)
    %chk = $replace(%chk,u,µ)
    %chk = $replace(%chk,v,v)
    %chk = $replace(%chk,w,w)
    %chk = $replace(%chk,x,x)
    %chk = $replace(%chk,y,¥)
    %chk = $replace(%chk,z,z)
  }
}
 


and thats the way the scout leader burns
#124797 11/07/05 02:38 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Try..

Code:
on 1:INPUT:*: {
  if (Status !isin $active) && ($left($1-,1) != /) {
    %chk = $1-
    %chk = $replace(%chk,a,ä)
    %chk = $replace(%chk,b,ß)
    %chk = $replace(%chk,b,ß)
    %chk = $replace(%chk,c,©)
    %chk = $replace(%chk,d,D)
    %chk = $replace(%chk,e,ë)
    %chk = $replace(%chk,f,F)
    %chk = $replace(%chk,g,¶)
    %chk = $replace(%chk,h,h)
    %chk = $replace(%chk,i,í)
    %chk = $replace(%chk,j,j)
    %chk = $replace(%chk,k,k)
    %chk = $replace(%chk,l,£)
    %chk = $replace(%chk,m,m)
    %chk = $replace(%chk,n,ñ)
    %chk = $replace(%chk,o,ó)
    %chk = $replace(%chk,p,P)
    %chk = $replace(%chk,q,q)
    %chk = $replace(%chk,r,®)
    %chk = $replace(%chk,s,¶)
    %chk = $replace(%chk,t,t)
    %chk = $replace(%chk,u,µ)
    %chk = $replace(%chk,v,v)
    %chk = $replace(%chk,w,w)
    %chk = $replace(%chk,x,x)
    %chk = $replace(%chk,y,¥)
    %chk = $replace(%chk,z,z)
  }
  msg $active %chk
  halt
}


-Andy

#124798 11/07/05 02:39 AM
Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
Code:
 on 1:INPUT:#: {
  if (Status !isin $active && $left($1-,1) != /) {
    %chk = $1-
    %chk = $replace(%chk,a,ä)
    %chk = $replace(%chk,b,ß)
    %chk = $replace(%chk,b,ß)
    %chk = $replace(%chk,c,©)
    %chk = $replace(%chk,d,D)
    %chk = $replace(%chk,e,ë)
    %chk = $replace(%chk,f,F)
    %chk = $replace(%chk,g,¶)
    %chk = $replace(%chk,h,h)
    %chk = $replace(%chk,i,í)
    %chk = $replace(%chk,j,j)
    %chk = $replace(%chk,k,k)
    %chk = $replace(%chk,l,£)
    %chk = $replace(%chk,m,m)
    %chk = $replace(%chk,n,ñ)
    %chk = $replace(%chk,o,ó)
    %chk = $replace(%chk,p,P)
    %chk = $replace(%chk,q,q)
    %chk = $replace(%chk,r,®)
    %chk = $replace(%chk,s,¶)
    %chk = $replace(%chk,t,t)
    %chk = $replace(%chk,u,µ)
    %chk = $replace(%chk,v,v)
    %chk = $replace(%chk,w,w)
    %chk = $replace(%chk,x,x)
    %chk = $replace(%chk,y,¥)
    %chk = $replace(%chk,z,z)
    msg $active %chk
    halt
  }
} 


hehe Snooop's code wink

-EDIT-

Argh, Andy beat me :tongue:

Last edited by xDaeMoN; 11/07/05 02:41 AM.

If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
#124799 11/07/05 02:52 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
You guys know you can do multiple replacements in one $replace call, right?

Also there's no point in replacing a string with the same string, like with t, v, x etc.

say $replace($1-,a,ä,b,ß,c,©,d,D,e,ë,f,F,g,¶,i,í,l,£,n,ñ,o,ó,p,P,r,®,s,¶,u,µ,y,¥)


Gone.
#124800 11/07/05 02:57 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Yes, but I didn't want to sit here doing the whole $replace() call, I saw it best to just add in the actual /MSG command. smile

-Andy

#124801 11/07/05 03:01 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
There's an error in your code btw, you're setting %chk to $1- only if the if condition was satisfied. However you've put the msg part out of that if statement, which means if the if statement wasnt satisfied, it will either msg $null or the previous value of %chk, which I'm sure he doesnt want smile


Gone.
#124802 11/07/05 03:03 AM
Joined: May 2005
Posts: 106
S
Vogon poet
OP Offline
Vogon poet
S
Joined: May 2005
Posts: 106
yep good old snoop can never make a thing work
jk


and thats the way the scout leader burns
#124803 11/07/05 03:33 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Since were all having shoots at each other ill join in!

Can i ask a question? Well actually im going to anyway.
Why is it that you dont want it to work in channels with the word Status in them ? Thats a pretty wierd restriction? <snicker snicker>

umm what else can i have a go at
//tokenize 32 this is a test | say $replace($1-,a,ä,b,ß,c,©,d,D,e,ë,f,F,g,¶,i,í,l,£,n,ñ,o,ó,p,P,hk,r,®,s,¶,u,µ,y,¥)
* Invalid parameters: $replace

ummm umm ok someone find the holes in this.... (there is one)
Code:
on *:input:#:{ input.event $1- } | ; remove if not wanted in this event
on *:input:?:{ input.event $1- } | ; remove if not wanted in this event
on *:input:=:{ input.event $1- } | ; remove if not wanted in this event
on *:input:!:{ input.event $1- } | ; remove if not wanted in this event
alias -l input.event {
  if ((!$halted) &amp;&amp; (!$ctrlenter) &amp;&amp; (!$inpaste) &amp;&amp; (!$istok(/ $readini($mircini, text, commandchar), $left($1, 1), 32))) {
    say $replace($1-,a,ä,b,ß,c,©,d,D,e,ë,f,F,g,¶,i,í,l,£,n,ñ,o,ó,p,P,r,®,s,¶,u,µ,y,¥)
    haltdef 
  }
}


Link Copied to Clipboard