mIRC Home    About    Download    Register    News    Help

Print Thread
#242049 13/06/13 02:31 PM
Joined: Jun 2013
Posts: 9
K
Kyance Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
K
Joined: Jun 2013
Posts: 9
Hello, could somebody help me make an echo script?
I'm not really so good at scripting, so i dunno how :\
For an example->
<~Kyance> Hello (On #K-Bot)
<~K-Bot> Kyance has said "Hello" on #K-Bot (On K-Bot's admin channel)
------
<~Kyance> !cmds (On #K-Bot)
<~K-Bot> Kyance has used the command "!cmds" on #K-Bot (On K-bot's admin channel again)
------
<&Bot> $2 has been kicked by Kyance (On #K-Bot)
<~K-Bot> $2 Has been kicked from #K-Bot by Kyance
-----
Something like that, i don't really need to see the !cmds etc, i would just want an admin channel, from where i could kick, or see what people do, lol.
<

Kyance #242064 14/06/13 04:51 PM
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Hello,

You want the k-bot to report some events-actions to an report channel (#k-bot) ? or you want when the k-bot use any event-action to inform you with an echo ?


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
westor #242072 15/06/13 06:39 PM
Joined: Jun 2013
Posts: 9
K
Kyance Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
K
Joined: Jun 2013
Posts: 9
Oh, sorry for the late reply.
Umm, well..
I would want it to, say the things, from #K-Bot(Main-Channel), to #adK-Bot(Admin-Channel)
Here's another(TYPED)example:
[21:37] <~Kyance> @invite Jbecchi
*The Invite/IRC etc stuff here*
[21:37] * TeamDRD sets mode +h Jbecchi for #K-Bot
[21:37] * K-Bot sets mode +v Jbecchi for #K-Bot
[21:37] <~K-Bot> Welcome, Jbecchi - Please read !help, and enjoy your stay!
[21:37] <%Jbecchi> hi
[21:37] <~Kyance> Hey
And then on #adK-Bot it says:
[21:37] <~K-Bot> Jbecchi has said "Hi" on #K-Bot.
[21:37] <~K-Bot> Kyance has said "Hey" on #K-Bot.
So, some actions i suppose.

Kyance #242081 16/06/13 08:26 AM
Joined: Jun 2013
Posts: 9
K
Kyance Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
K
Joined: Jun 2013
Posts: 9
So um, i tried starting some command for that-
on *:TEXT:*:#adK-Bot: {
if ( $1 == !akick ) {
if ( $2 == $null ) { msg $chan 5/ERROR\ 3Usage: !akick NAME

else kick #K-Bot $2
}
}
}
But it only does the first part:
[11:22] * TeamDRD sets mode +qo Kyance Kyance for #adK-Bot
[11:22] * K-Bot sets mode +v Kyance for #adK-Bot
[11:22] <~K-Bot> Welcome, Kyance - Please read !info, and enjoy your stay!
[11:22] ->> Channel Modes are: +ntr
[11:22] ->> Channel created on 2013.06.15. 20:26:49
[11:23] <~Kyance> !akick Jb|Sleeping
[11:23] <~Kyance> !akick
[11:23] <~K-Bot> /ERROR\ Usage: !akick NAME
I figured out, that the problem is at the : "else kick #K-Bot"
Cause, i tried "msg" etc.
-------------------------
So i tried a small test ->
on *:TEXT:*:#adK-Bot: {
if ( $1 == !test )
/mode #K-Bot +m
}
And it didn't work.. D;
------------------------
Okay, so i made the "Echo" script, i suppose..
on *:TEXT:*:#K-Bot: {
msg #adK-Bot $nick said " $1- " On #K-Bot!
}

Last edited by Kyance; 16/06/13 11:22 AM.
Kyance #242105 17/06/13 03:35 AM
Joined: May 2012
Posts: 12
T
Pikka bird
Offline
Pikka bird
T
Joined: May 2012
Posts: 12
Hi there, so it seems like you want your script to echo something from one channel to another and do various commands? I think I can help.

Code:
on *:TEXT:*:#K-bot:{
msg #adK-bot $nick said " $+ $1- $+ " on #K-bot!
}

Basically copying what you wrote, because it is correct. Just a cool tip for the future, whenever something interferes with identifiers or variables, just use "$+", because it attaches the two while still displaying the identifier/variable.

For actions, such as kicking, you figured it out. To do a command, don't include the msg at the front.

As for your test, it didn't work because you forgot some parentheses. You should include another pair after the if statement:
Code:
on *:TEXT:*:#adK-Bot: {
if ( $1 == !test ) {
/mode #K-Bot +m[b]
}[/b]
}


Seems like you're slowly but surely figuring it out. Let me know if there's anything else I can help with. smile

TheRandomDog #242106 17/06/13 07:31 AM
Joined: Jun 2013
Posts: 9
K
Kyance Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
K
Joined: Jun 2013
Posts: 9
Woah, thanks!
But the command wasn't really the one i was looking for :s
I was looking for a command, something like this ->
on *:TEXT:*:#adK-Bot: {
if ( $1 == !amute ) {
if ( $2 == $null ) { msg $chan 5/ERROR\ 3Usage: !amute NAME

/mode $2 -qaov (I bet im incorrect here)
/mode #K-Bot +mi
}
}
}
It does "@down *NICK*", and then sets the mode to Moderated and Invite only, so he couldn't evade the mute so simply i suppose..
---------------
EDIT:
---------------
So, i edited the mute script ->
on *:TEXT:!amute:#adK-Bot: {
if ( $2 == $null ) { msg $chan 4/5/6ERROR5\4\3Usage: !amute NAME

else msg #K-Bot @down $2
/mode #K-Bot +mi
}
}
And it did this, in #adK-Bot
[10:35] <~Kyance> !amute
[10:35] <~K-Bot> //ERROR\\Usage: !amute NAME
[10:35] <~Kyance> !amute Jb|Sleeping
Then i looked at #K-Bot
[10:35] * K-Bot sets mode +mi for #K-Bot
I did noticed that you said something about the "msg", but i still tried, gonna set it with /mode, if i find out how..
--------
2nd Edit
--------
So, i tried removing/changing the "else msg #K-Bot @down $2"
But if i changed that, then the /mode #K-Bot +mi didn't work..
I think it's super bugged D:

Last edited by Kyance; 17/06/13 07:41 AM.
Kyance #242107 17/06/13 10:25 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
I think your problems all result from incorrect placement of brackets {}. Brackets are used to tell mIRC what part goes with what part. If you have an IF or ELSE statement, then anything between the following {}'s goes with that. A new line doesn't make a different command.

Example:

Code:
if (%var == 1) { echo -a 1
echo -a  2
echo -a  3
}


This will echo 1, 2, and 3 if %var == 1 because they are all between the brackets even though they are on separate lines.


Code:
if (%var == 1) { echo -a 1 }
echo -a  2
echo -a  3


This will only echo 1 if %var == 1 and then will echo 2 and 3 no matter what because they are not within the {}'s of the IF.

The same goes with using ELSE. Anything within the {}'s following the ELSE will be part of the ELSE and will trigger if the ELSE is triggered. Anything outside of the {}'s will trigger no matter what. So in your code:

Code:
if ( $2 == $null ) { msg $chan 4/5/6ERROR5\4\3Usage: !amute NAME

else msg #K-Bot @down $2
/mode #K-Bot +mi
}


The else is IN the IF statement, which wouldn't work. You need a closing } after the IF commands are done. Then, you aren't using {}'s on the ELSE line. That's fine if you only want what is on the line to be part of the ELSE. But what you have here is a problem. If you close the IF like you should with a }, then the mode command isn't part of the IF or the ELSE and will always trigger even if the IF gets triggered saying that the format is wrong. It should be part of your ELSE, so you'd want {}'s around everything relating to the ELSE statement.

Think of {}'s as a way to enclose what you want done in a statement when you want multiple lines to be part of the statement.

Pseudo code:
Code:
IF (this) { do this
  and this
  and this
}
ELSE { do this
  and this
  and this
}


*Note that the first "do this" on each of those can be on a separate line instead of on the same line as the IF and ELSE if you prefer, but it doesn't really matter other than preference or readability.


Invision Support
#Invision on irc.irchighway.net
Riamus2 #242179 21/06/13 06:02 AM
Joined: Jun 2013
Posts: 9
K
Kyance Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
K
Joined: Jun 2013
Posts: 9
Thank you so much!
Now it works perfectly! laugh

I did answer late, cause at first it didn't work, then i took a look at the Pseudo code, and it worked smile
Thank you, again smile


Link Copied to Clipboard