Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mIRC Bot simulate keystrokes

Tags:

irc

mirc

I would like to program my mIRC bot so every time someone writes "W" in the chat, the bot simulates the W key on my keyboard.

I have tried:

on *:text:W:#:sendkeys {W}
alias sendkeys var %a = $ticks
 .comopen %a WScript.Shell | if !$comerr {
 .comclose %a $com(%a,SendKeys,3,bstr,$1-) 
}

This doesn't seem to be working. Any advice?

like image 441
user1172897 Avatar asked Mar 01 '26 19:03

user1172897


1 Answers

The code is fine, the blocks in which you execute that code are incorrect. Due to a lack of brackets, your alias will only execute the var command, and be done after that.

Taken from the mIRC help files:

The { } brackets: You can create multi-line scripts by using the { } brackets. This allows you to create an alias which performs several commands.

alias sendkeys {
  var %a = $ticks
  .comopen %a WScript.Shell
  if !$comerr {
    .comclose %a $com(%a,SendKeys,3,bstr,$1-) 
  }
}
like image 90
Patrickdev Avatar answered Mar 05 '26 03:03

Patrickdev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!