mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2007
Posts: 21
A
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Aug 2007
Posts: 21
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 ^^

Joined: Aug 2007
Posts: 21
A
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Aug 2007
Posts: 21
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 ^_^

Last edited by Ash44455666; 29/08/07 06:19 PM.
Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
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!
}

Joined: Aug 2007
Posts: 21
A
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Aug 2007
Posts: 21
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))

Last edited by Ash44455666; 29/08/07 07:24 PM.
Ash44455666 #184494 29/08/07 07:47 PM
Joined: Aug 2007
Posts: 21
A
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Aug 2007
Posts: 21
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?

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
$calc($3 * 60) should work. If not: show us your current code smile

Horstl #184498 29/08/07 09:09 PM
Joined: Aug 2007
Posts: 21
A
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Aug 2007
Posts: 21
thanks, it definately worked. would you know how I could set a channel to autovoice anyone who enters?

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Check mIRC's /avoice command.

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
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 }
}


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Lpfix5 #184506 29/08/07 10:02 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Alternatively
Code:
on @*:join:#: .mode # +v $nick

RusselB #184508 29/08/07 10:12 PM
Joined: Aug 2007
Posts: 21
A
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Aug 2007
Posts: 21
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.

Last edited by Ash44455666; 29/08/07 10:39 PM.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net
Riamus2 #184523 30/08/07 12:42 AM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
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.


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Riamus2 #184529 30/08/07 01:52 AM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
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

Joined: Aug 2007
Posts: 21
A
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Aug 2007
Posts: 21
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?

Last edited by Ash44455666; 30/08/07 03:51 AM.

Link Copied to Clipboard