mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#108351 19/01/05 05:13 AM
Joined: Dec 2004
Posts: 80
C
Babel fish
OP Offline
Babel fish
C
Joined: Dec 2004
Posts: 80
how u make a script that leave a channel when like:
example: !part #blah
and then the bot quit #blah,how u do that? and same thing with the join script,how u make one of those script?...like !join #blah,the bot joins the channel,how? pelase help me


practice makes perfect... smile
Joined: Aug 2004
Posts: 423
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
here's a tip for ya CyborAccess,

try using this sites search feature... i know there is at least two threads on this subject....

Joined: Nov 2004
Posts: 332
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
if u look through my script that i pasted
or the bot rather
you should see it
but the hell with it
it goes without saying that you insert a user level if u want one ok
Code:
on *:text:!part:#:{
part $chan
}

on *:text:!part *:*:{
part $$2-
}  

the first one you enter in a channel and the bot parts that channel just !part
the second one you can either enter ina channel or through a msg and you specify the channel you want it to part
i.e. !part #sensei
i trust this will suffice


The Kodokan will move you, one way or another.
Joined: Nov 2004
Posts: 332
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
i almost forgot the join
Code:
on *:text:!join *:*:{
join $$2-
}  


The Kodokan will move you, one way or another.
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Ricky, it's a bot. I don't think the original poster would actually let that command be triggered when everyone says it. Which I really don't think would be such a grand idea, because you get some idiots who will just flood the bot off with masses of joins.

Cybor: /guser owner Your_Nick 2

Ricky, one slight alteration.
Code:
On owner:Text:!join *:#: {
  if ($ulist($ial($me))) {
    join [color:red]#[/color]$$2-
  }
}

Joined: Nov 2004
Posts: 332
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
you realize im just handing him the bare minimum so he can get the idea and carry it himself
but oh well
the # i leave out on mine beacuase i know to type it
althought i would have thought u would need a $+
between # and $$2-
:tongue:
oh yeah why did u make it purely on chan
then if his bot is say on no channels for whatever reason he cant make it join remotely
thats why i use either * or ?
in this case * if it will work

Last edited by ricky_knuckles; 19/01/05 08:09 PM.

The Kodokan will move you, one way or another.
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Actually his example works.

Try it out: //tokenize 32 testing | join #$1

Will join #testing. This is an exception though, and doesn't work in other cases, since normally identifiers need to be atleast preceeded by a space in order to evaluated (when not part of another identifier itself that is, or some other exceptions like in popups where you can put a . before an identifier like $iif fex)

Greets


Gone.
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
This a general reply, i'm just replying to Slade because his is the post I was reading before making this reply smile

It might be a good idea to add a check to make sure they don't try and make you join 0 (/join 0, /join 00, /join 000, etc), which is the equivalent of /partall.

Code:
on *:text:!join *:#:{
  var %a, %b = $regsub($$2,/(?<=^|\x2C)0+(?=\x2C|$)/g,,%a)
  join %a
}


New username: hixxy
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Indeed. Good point. smile

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Is there anything you don't moan about? You moan about everything in every little detail.

Quote:

oh yeah why did u make it purely on chan
then if his bot is say on no channels for whatever reason he cant make it join remotely
thats why i use either * or ?
in this case * if it will work


Go ahead dude, add the stupid asterisk.

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
That's a good idea, but it could be improved a bit, since right now it doesn't work if you use spaces like:

#one , 000 , #two

I figured, we could as well replace any occurences of a channel specified without its prefix #, since that would give an error to join. This will catch the 0's as well, all in one.

The good thing is that it does give support for channel keys:

var %a, %b = $regsub($2-,/(?<=^|\x2C)\s?[^#]+/g,,%a)

On the test string: bla #one test, #two , 00 ,test #three four
it gave: #one test,#two ,#three four

I'm sure the regex can be improved, though I gotta go, going to the movies :tongue:

Greets


Gone.
Joined: Nov 2004
Posts: 332
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
there you go breaking the regex out confused


The Kodokan will move you, one way or another.
Joined: Nov 2004
Posts: 332
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
did you not just gripe at me about having the #$$2-
yeah sit down


The Kodokan will move you, one way or another.
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
If you try and /join #one , 000 , #two all that will happen is you join #one. smile
/join doesn't accept spaces between channel names.

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Interesting.

I'm honestly surprised, because the comma's are the delimiter, it seems weird why spaces would matter, since they can't be part of a channel name.

Oh well, the regex still works, but its merit is reduced to simply removing 0's and channel names without the # prefix.

Greets


Gone.
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Comma between channelnames and between keys, space between channels and keys
join #channel key
join #chan1,#chan2 key1,key2

Oh and don't forget $chantypes is not always only # smile

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
What would this join: join #chan1,#chan2 key1,key2 ?

chan1 with key1 and chan2 with key2...never knew that, always thought it was:

chan key, chan key, chan key

Heh, you might be surprised I don't know this stuff, but I rarely chat, I use mIRC mainly to script laugh

Well then the regex I posted should be discarded, since it was created with incomplete knowledge about joining channels.

Greets

Last edited by FiberOPtics; 19/01/05 11:53 PM.

Gone.
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Why does this sound like Deja Vu Fiber? It sounds like this was said the exact same time yesterday. :tongue:

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
I went to bed at 11 pm yesterday, that was 2 hours before now, so I don't know what and where something about joining channels was said exactly at this time.

Eh?


Gone.
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Sorry, in regards with:

Quote:

Heh, you might be surprised I don't know this stuff, but I rarely chat, I use mIRC mainly to script


grin

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Stop talking in riddles lol, what's the deja vu and what do I have to do with it o.O? :tongue:


Gone.
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
What would this join: join #chan1,#chan2 key1,key2 ?
chan1 with key1 and chan2 with key2

Yes exactly smile

join #chan1,#chan2 0,key2
to join #chan1 with 0 key (either 0 literally or no key and using the 0 as a placeholder) and #chan2 with key2

Technically this should work for the last... /join #chan1,#chan2 ,key2 ...but some ircds don't accept the empty parameter

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Hehehehe, well that is something we was talking about on MSN last night. I've just looked back, seems it was around half 9 not this time. laugh

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
LOL yea I remember now, couldn't have been 2 pm hehe. Yep deja vu indeed smile


Gone.
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Thanks, good to know.


Gone.
Joined: Dec 2004
Posts: 80
C
Babel fish
OP Offline
Babel fish
C
Joined: Dec 2004
Posts: 80
so how u make a simple part channel script and a join channel script that only works when i type it but when othee people type it dont work? confused confused confused


practice makes perfect... smile
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Code:
on owner:text:!join *:#:{
  if ($ulist($ial($me))) {
    var %a, %b = $regsub($$2,/(?&lt;=^|\x2C)0+(?=\x2C|$)/g,,%a)
    join %a
  }
}


Add yourself to the user list.

/guser owner <your nick> 2

Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
To add support for channel keys to mine just change join %a to join %a $3- smile


New username: hixxy
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Heh well, like I said, I made that regsub with incomplete knowledge about how you can join channels with keys in that particular way, so every comment I've made on the matter should be discarded.

Greets


Gone.
Page 1 of 2 1 2

Link Copied to Clipboard