Professional Documents
Culture Documents
New Text Document
New Text Document
(function() {
'use strict';
/// Haxball quick script for avatars, texts, spams. by alpha ///
/// For using this script, append the script into console log while haxball is on
browser. ///
/// I recommend that backup this script for using again, if you lose it! ///
/// You can store your emojis below here and copy paste it.
//????
// When you want to return your default avatar above after pressing avatar keys
let defAvatarActiveKey1 = '?';
let defAvatarActiveKey2 = '?';
// Key for changing main mode [Avatar, Text, Chat Spam, Avatar Spam]
let changeMainMode1 = 'Shift';
let changeMainMode2 = '<<<EMPTY>>>';
/// Keys
// You can set the keys up from here to change avatar, type text and so on.
// These keys are important for using features of the script.
// For example key4 belongs to both configAvatar4 and configText4 below in
confugiring avatars and texts.
// If you press key4 whereas a2(avatar slot #2) is activated, you select avatar of
configAvatar4 and its second column.
let configText1 = [
"", // First column
"", // Second column
"", // Third column
"" // Fourth column
];
let configText2 = [
"Goooooooooooooooaaaalllll!!!",
"",
"",
""
];
let configText3 = [
"Pass!!!",
"",
"",
""
];
let configText4 = [
"Cmoonnn!!!",
"",
"",
""
];
let configText5 = [
"Nice Goal!!!",
"",
"",
""
];
let configText6 = [
"",
"",
"",
""
];
let configText7 = [
"",
"",
"",
""
];
let configText8 = [
"",
"",
"",
""
];
let configText9 = [
"",
"",
"",
""
];
//////////////////
/// DEBUG MODE ///
//////////////////
// If you wanna see which key do you press via console, you should make this true
// This is useful when you wanna see which key do you wanna change modes with.
let debugModeActive = false;
let avatarPressed = 0;
if(frameWin == null)
{
setInterval(function(){
inputHax = document.querySelector('.input input');
buttonHax = document.querySelector('.input button');
console.log('Input Element Has Been Changed!')
}, 2000)
document.addEventListener('keydown', function(){
press(event.key);
debugMode(event.key);
});
}
else
{
frameDoc = frameWin.document;
setInterval(function(){
inputHax = frameDoc.querySelector('.input input');
buttonHax = frameDoc.querySelector('.input button');
frameDoc = frameWin.document;
console.log('Input Element Has Been Changed!')
}, 2000)
frameWin.addEventListener('keydown', function(){
press(event.key);
debugMode(event.key);
});
}
switch(mode)
{
case modes[0]:
modeDisplay = avatarMode;
break;
case modes[1]:
modeDisplay = textMode;
break;
case modes[2]:
modeDisplay = chatSpamMode;
break;
case modes[3]:
modeDisplay = avatarSpamMode;
break;
}
if(mode == 'a')
{
switch(key)
{
case key1_1:
case key1_2:
changeAvatar(configAvatar1[avatarModes.indexOf(avatarMode)]);
break;
case key2_1:
case key2_2:
changeAvatar(configAvatar2[avatarModes.indexOf(avatarMode)]);
break;
case key3_1:
case key3_2:
changeAvatar(configAvatar3[avatarModes.indexOf(avatarMode)]);
break;
case key4_1:
case key4_2:
changeAvatar(configAvatar4[avatarModes.indexOf(avatarMode)]);
break;
case key5_1:
case key5_2:
changeAvatar(configAvatar5[avatarModes.indexOf(avatarMode)]);
break;
case key6_1:
case key6_2:
changeAvatar(configAvatar6[avatarModes.indexOf(avatarMode)]);
break;
case key7_1:
case key7_2:
changeAvatar(configAvatar7[avatarModes.indexOf(avatarMode)]);
break;
case key8_1:
case key8_2:
changeAvatar(configAvatar8[avatarModes.indexOf(avatarMode)]);
break;
case key9_1:
case key9_2:
changeAvatar(configAvatar9[avatarModes.indexOf(avatarMode)]);
break;
}
}
if(mode == 't'){
switch(key)
{
case key1_1:
case key1_2:
inputHax.value = configText1[textModes.indexOf(textMode)];
buttonHax.click();
break;
case key2_1:
case key2_2:
inputHax.value = configText2[textModes.indexOf(textMode)];
buttonHax.click();
break;
case key3_1:
case key3_2:
inputHax.value = configText3[textModes.indexOf(textMode)];
buttonHax.click();
break;
case key4_1:
case key4_2:
inputHax.value = configText4[textModes.indexOf(textMode)];
buttonHax.click();
break;
case key5_1:
case key5_2:
inputHax.value = configText5[textModes.indexOf(textMode)];
buttonHax.click();
break;
case key6_1:
case key6_2:
inputHax.value = configText6[textModes.indexOf(textMode)];
buttonHax.click();
break;
case key7_1:
case key7_2:
inputHax.value = configText7[textModes.indexOf(textMode)];
buttonHax.click();
break;
case key8_1:
case key8_2:
inputHax.value = configText8[textModes.indexOf(textMode)];
buttonHax.click();