Skip to content

Instantly share code, notes, and snippets.

@ion1
Last active April 24, 2022 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ion1/0b2e5055089b8484d55c5369453b2039 to your computer and use it in GitHub Desktop.
Save ion1/0b2e5055089b8484d55c5369453b2039 to your computer and use it in GitHub Desktop.
IdleRPG bot login automation with WeeChat

IdleRPG bot login automation with WeeChat

Log in when joining the channel

/trigger addreplace libera_idlerpg_login_join signal libera,irc_in2_353 "${text} =~ ^. #idlerpg :(.+ )?@idlebot( |$)" "" "/msg -server ${server} idlebot login user password"

Log in when idlebot gains +o

This does not handle e.g. a previously opped idlebot_ changing its nickname to idlebot.

This also does not handle a mode command with multiple modes.

/trigger addreplace libera_idlerpg_login_op signal libera,irc_in2_mode "${channel} == #idlerpg && ${text} == +o idlebot" "" "/msg -server ${server} idlebot login user password"

Hide the password

/set irc.look.nicks_hide_password nickserv,idlebot
/trigger addreplace idlerpg_password modifier "5000|irc_message_auth" "" "==^(login +[^ ]+ +|register +[^ ]+ +|newpass +)([^ ]+)(.*)==${re:1}${hide:*,${re:2}}${re:3}"
@pensive-fuzz
Copy link

pensive-fuzz commented Apr 16, 2022

After trying to figure out how to adopt the code to use on IdleRPG on another server, I'm posting this updated generalized login when joining channel in case it helps anyone else:

command:1

/trigger addreplace IRPG_TRIGGER signal SERVER,irc_in2_353 "${text} =~ ^. CHANNEL :(.+ )?OP_BOT( |!|$)" "" "/msg -server ${server} BOT login IRPG_USER IRPG_PASS"
variable purpose
IRPG_TRIGGER trigger name
SERVER name you gave server (with /server add command)
CHANNEL name of #idlerpg channel
OP_BOT name of idlerpg bot; append op ranking2
BOT name of idlerpg bot
IRPG_USER user name used when you created idlerpg account3
IRPG_PASS password used when you created idlerpg account3

note 1: when looking for the idlebot libera only report nick, but some servers report nick!name@address so the command was updated to handle such situations
note 2: I encountered different op status on the idlerpg bots, which translated to &:&@, @:@, %:%
note 3: you can and may want to use secured data for these fields

And if all else fails, use:

/trigger watch IRPG_TRIGGER

to see what the trigger's parsing so that you can try to modify it to work for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment