mIRC Homepage

part script and join script

Posted By: CyborAccess

part script and join script - 19/01/05 05:13 AM

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
Posted By: clutz1572

Re: part script and join script - 19/01/05 05:17 AM

here's a tip for ya CyborAccess,

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

Re: part script and join script - 19/01/05 05:55 AM

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
Posted By: ricky_knuckles

Re: part script and join script - 19/01/05 05:57 AM

i almost forgot the join
Code:
on *:text:!join *:*:{
join $$2-
}  
Posted By: SladeKraven

Re: part script and join script - 19/01/05 10:44 AM

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-
  }
}
Posted By: ricky_knuckles

Re: part script and join script - 19/01/05 08:07 PM

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
Posted By: FiberOPtics

Re: part script and join script - 19/01/05 08:20 PM

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
Posted By: tidy_trax

Re: part script and join script - 19/01/05 08:39 PM

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
}
Posted By: SladeKraven

Re: part script and join script - 19/01/05 08:40 PM

Indeed. Good point. smile
Posted By: SladeKraven

Re: part script and join script - 19/01/05 08:47 PM

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.
Posted By: FiberOPtics

Re: part script and join script - 19/01/05 09:04 PM

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
Posted By: ricky_knuckles

Re: part script and join script - 19/01/05 09:41 PM

there you go breaking the regex out confused
Posted By: ricky_knuckles

Re: part script and join script - 19/01/05 09:44 PM

did you not just gripe at me about having the #$$2-
yeah sit down
Posted By: Iori

Re: part script and join script - 19/01/05 11:02 PM

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.
Posted By: FiberOPtics

Re: part script and join script - 19/01/05 11:39 PM

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
Posted By: Iori

Re: part script and join script - 19/01/05 11:45 PM

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
Posted By: FiberOPtics

Re: part script and join script - 19/01/05 11:49 PM

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
Posted By: SladeKraven

Re: part script and join script - 19/01/05 11:53 PM

Why does this sound like Deja Vu Fiber? It sounds like this was said the exact same time yesterday. :tongue:
Posted By: FiberOPtics

Re: part script and join script - 19/01/05 11:55 PM

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?
Posted By: SladeKraven

Re: part script and join script - 20/01/05 12:00 AM

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
Posted By: FiberOPtics

Re: part script and join script - 20/01/05 12:02 AM

Stop talking in riddles lol, what's the deja vu and what do I have to do with it o.O? :tongue:
Posted By: Iori

Re: part script and join script - 20/01/05 12:10 AM

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
Posted By: SladeKraven

Re: part script and join script - 20/01/05 12:12 AM

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
Posted By: FiberOPtics

Re: part script and join script - 20/01/05 12:14 AM

LOL yea I remember now, couldn't have been 2 pm hehe. Yep deja vu indeed smile
Posted By: FiberOPtics

Re: part script and join script - 20/01/05 12:17 AM

Thanks, good to know.
Posted By: CyborAccess

Re: part script and join script - 20/01/05 06:03 AM

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
Posted By: SladeKraven

Re: part script and join script - 20/01/05 10:26 AM

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
Posted By: tidy_trax

Re: part script and join script - 20/01/05 02:42 PM

To add support for channel keys to mine just change join %a to join %a $3- smile
Posted By: FiberOPtics

Re: part script and join script - 20/01/05 04:46 PM

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
© 2019 mIRC Discussion Forums