Skip to content

Instantly share code, notes, and snippets.

View AndrioCelos's full-sized avatar

Andrio Celos AndrioCelos

View GitHub Profile
@AndrioCelos
AndrioCelos / ZNCBufferPlayback.kvs
Last active August 29, 2015 14:00
A buffer playback script for KVIrc. It displays all messages from buffer playback in different colours, and stops them from highlighting you. It also assumes that you have PrependTimestamp set, and works with *buffextras (though not completely).
event(OnKVIrcStartup,_ZNCBufferPlayback)
{
%NicknameColours = $array($k(0,1), $k(0,2), $k(0,3), $k(0,4), $k(0,5), $k(0,6), $k(0,10), $k(0,12), $k(0,14), $k(1,0), $k(1,4), $k(1,7), $k(1,8), $k(1,9), $k(1,11), $k(1,15), $k(2,0), $k(2,4), $k(2,7), $k(2,8), $k(2,9), $k(2,11), $k(2,15), $k(3,8), $k(3,9), $k(3,0), $k(3,15), $k(4,0), $k(4,1), $k(4,8), $k(4,9), $k(4,11), $k(4,15), $k(5,0), $k(5,7), $k(5,8), $k(5,15), $k(6,0), $k(6,7), $k(6,8), $k(6,9), $k(6,10), $k(6,11), $k(6,15), $k(7,1), $k(7,2), $k(7,5), $k(7,6), $k(7,14), $k(8,1), $k(8,2), $k(8,3), $k(8,4), $k(8,5), $k(8,6), $k(8,7), $k(8,10), $k(8,12), $k(8,14), $k(9,1), $k(9,2), $k(9,3), $k(9,5), $k(9,6), $k(9,14), $k(10,1), $k(10,2), $k(11,1), $k(11,2), $k(11,3), $k(11,5), $k(11,6), $k(11,14), $k(12,0), $k(12,7), $k(12,8), $k(12,9), $k(12,10), $k(12,11), $k(12,15), $k(13,0), $k(13,1), $k(13,6), $k(13,8), $k(13,11), $k(13,15), $k(14,0), $k(14,8), $k(14,11), $k(14,15), $k(15,1), $k(15,2), $k(15,3), $k(15,6), $k(15,14))
}
event(OnChannelMessage,_ZNCBufferPlay
event (OnTextInput, SymbolShortcut) {
if (%Processing == $true) {return;}
%Processing = $true;
%output = "";
%i = 0;
while (%i < $str.length($0)) {
if (%i == 0 && $str.mid($0, %i, 2) == "//") {%output .= "/say /"; %i += 2; continue;}
%c = $str.mid($0, %i, 1);
if (%c == "`") {
if ($str.cmp($str.mid($0, %i, 5), "`ctcp", true) == 0) {%output .= $char(1); %i += 5; continue;}
@AndrioCelos
AndrioCelos / digits.png
Last active February 28, 2021 00:28
In IRC, there is a limit on how long a line can be. This limit is 512 bytes, including the command name and the CR+LF at the end, though some servers enforce it differently. This mIRC script will show you how much space you have left for your message, including channel topics. I have two versions: one that uses the toolbar for the display, the o…
digits.png
@AndrioCelos
AndrioCelos / BattleArenaStatus.kvs
Last active August 29, 2015 14:12
This is a set of KVIrc scripts to be used with the game Battle Arena. It creates a window that appears when you join a battle, that shows your health and TP. Presently, this is styled on the status screen in Dragon Quest IX, though I may change that. For it to work propery, the TP database (TP.dat) must be in your KVIrc config folder ($file.loca…
event(OnKVIrcStartup,ArenaStatus)
{
%ArenaIndex = 0;
// Edit this to reflect the actual Arena you're in and your actual status there.
%Arena[0] = $new(arenaStatus);
%Arena[0]->%Network = "EsperNet";
%Arena[0]->%Channel = "#BattleArena";
%Arena[0]->%BotNickname = "BattleArena";
// Parameters for $addPlayer: name, colour (red, green, blue), HP, TP, TP regeneration
--- a/battlearena/battlealiases.als
+++ b/battlearena/battlealiases.als
@@ -2967,6 +2967,8 @@ spawn_after_death {
write $txtfile(battle.txt) %monster.to.spawn
var %battlemonsters $readini($txtfile(battle2.txt), BattleInfo, Monsters) | inc %battlemonsters 1 | writeini $txtfile(battle2.txt) BattleInfo Monsters %battlemonsters
+ check_drops %monster.to.spawn
+
; display the description of the spawned monster
$set_chr_name(%monster.to.spawn)
@AndrioCelos
AndrioCelos / patch.mrc
Last active September 29, 2015 12:00
This script is no longer in use. We use the actual patch utility now.
alias patch {
if ($1 == augment-list-fix) {
noop $read(characters.als, nr, ^ *set {1}%weapon_augment \$readini\(\$char\(\$1\), augments, \%weapon\.name\))
var %line = $readn
if (%line == 0) {
echo 4 Could not find the reference point in characters.als.
return
}
write -l $+ %line characters.als $eval( set %weapon_augment $readini($char($1), augments, $strip(%weapon.name)), 0)
%add = $true;
%clones = ""; %cloneCount = 0;
for (%i=0;%i<$length(%PastUsers{$context});%i++) {
if ($0 == $mask.nick(%PastUsers{$context}[%i])) {
%add = $false;
}
elseif ($2 == $mask.host(%PastUsers{$context}[%i])) {
if (%cloneCount < 10) %clones <, " \r!n\r$mask.nick(%PastUsers{$context}[%i])\r";
%cloneCount++;
}
@AndrioCelos
AndrioCelos / CBotConfig.ini
Last active November 22, 2015 15:32
Example configuration files for CBot.
[Me]
; The nicknames the bot will try to use, in order of preference.
Nicknames=Angelina,Lina
; The ident name of the bot.
Username=Angelina
; The full name/real name/gecos of the bot.
FullName=2Angelina
; The response to CTCP USERINFO.
UserInfo=CBot by Andrio Celos
@AndrioCelos
AndrioCelos / manager.mrc
Last active November 23, 2015 04:20
This script is required for CBot's BattleArenaManager plugin to work correctly. It allows the bot to remotely reload scripts.
on *:TEXT:!!reload *:*:{
; Replace this with your bot's vHost.
if ($address != ~Angelina@questers-rest.andriocelos.ml) return
var %i 2
var %count $0
while (%i <= %count) {
var %file = $gettok($1-, %i, 32)
if (*.als iswm %file) reload -a %file
else reload -rs %file
event (OnWindowActivated, font) {
if ($window.type == console)
option fontIrcView Consolas,10,5,50
else
option fontIrcView Verdana,10,5,50;
}