mIRC Homepage
I downloaded mIRC today (and might I say it absolutely owns), however I've been trying to work on a bot for United Battle Grounds chat room, however the scripting language is somewhat confusing to me. Now know I've done some other languages including C++, HTML and flash (actionscript). But I just thought I'd ask for a little assistance from all the people who actually know what they're doing smile

Here's an example. If an op says something like, "!say Welcome to UBG" I want the bot to respond with "Welcome to UBG". Very simple, but I can't get it to work lol. I got a "!hi" script to work though wink

I'm thinking I just need to learn how to work with variables in the meantime. So if anyone could be nice and assist me with that then ty ^^
Okey I find out I just needed to use $2- to get that to work. Now I'm going to try to make a script "!me lalala..." that turns into, from the bot, "/me lalala...". Thanks for anyone who read my thread smile

Edit: I can't get /me to work, since it has to /msg the channel. How would I go around doing this? Any help is highly appreciated ^_^
If you want to use /me in scripts, you'll need to use /describe

So:

Code:
on *:TEXT:!me send lemmings:#:{
  describe $chan sends hordes of lemmings!
}
Thanks OrionsBelt laugh this is exactly what I needed

How do you check someone's current status in the channel? For example, see if they're voice/halfop/op/leader?

nvm found it out smile
if (($nick isop $chan) || ($nick ishop $chan))
Posted By: Ash44455666 timer problem - 29/08/07 07:47 PM
I made a small bit of script that allows halfops and ops to dv and v users. I tried to make it so that if they typed "!dv spammer 5" it would devoice a spammer for 5 minutes. But it isn't working >.< I tried lots of things but I can only make it devoice the user spammer for 5 seconds. Any type of multiplication doesn't seam to be working O.o so what should I do here?
Posted By: Horstl Re: timer problem - 29/08/07 07:54 PM
$calc($3 * 60) should work. If not: show us your current code smile
Posted By: Ash44455666 Re: timer problem - 29/08/07 09:09 PM
thanks, it definately worked. would you know how I could set a channel to autovoice anyone who enters?
Posted By: RusselB Re: timer problem - 29/08/07 09:14 PM
Check mIRC's /avoice command.
Posted By: Lpfix5 Re: timer problem - 29/08/07 09:35 PM
Originally Posted By: Ash44455666
thanks, it definately worked. would you know how I could set a channel to autovoice anyone who enters?


/avoice command allows you to add the people you want however if you want everyone to be voiced as they enter your channel then

on *:JOIN:#:{
if ($me isop #) { mode # +v $nick }
}
Posted By: RusselB Re: timer problem - 29/08/07 10:02 PM
Alternatively
Code:
on @*:join:#: .mode # +v $nick
Posted By: Ash44455666 Re: timer problem - 29/08/07 10:12 PM
tyvm once more smile

nevermind I managed to fix it, turned out I had another code of JOIN earlier in the code and the second one didn't work.
Posted By: Riamus2 Re: timer problem - 29/08/07 11:19 PM
Note that it can be dangerous to make a bot that repeats text. A user can type !say /quit and your bot will quit. And that's just a very minor example of the danger.
Posted By: Lpfix5 Re: timer problem - 30/08/07 12:42 AM
Originally Posted By: Riamus2
Note that it can be dangerous to make a bot that repeats text. A user can type !say /quit and your bot will quit. And that's just a very minor example of the danger.


Actually it is in theory not dangerous has mIRC does not evaluate commands when it /describes, /msg or /say a command as the return.

It will treat it as plain text. Thus why, there's no danger at all.
Posted By: genius_at_work Re: timer problem - 30/08/07 01:52 AM
The danger is when a command is used to double evaluate $1- such as a timer or scon command (as well as several others).

-genius_at_work
I can't get a single type of code that has to use something called a socket to work (I'm all confused by it anyways). For example of one of the codes would be http://forum.swiftirc.net/viewtopic.php?t=10431&highlight=simple+stat
I've attempted to implement it as well as lots of somewhat similar codes, but when I !price -item- or !stats -player- or etc. absolutely NOTHING happens frown if anyone knows why that would be great lol
Could it be because of the new version of mIRC? Is this making it so older codes don't work?
© mIRC Discussion Forums