Here's some useful code for you struggling to make bots.
const HEADERS = {
"Accept": "/",
"Accept-Encoding": "identity",
"Accept-Language": "*",
"Cache-Control": "no-cache",
"Connection": "keep-alive",
"Cookie": "",
"Host": "www.windows93.net",
"Origin": "http://www.windows93.net",
"Pragma": "no-cache",
"Referer": 'http://www.windows93.net/trollbox/index.php',
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36"
function TrollboxSocket() {
//let agent = new HttpProxyAgent(proxyaddr);
return io.connect("http://www.windows93.net:8081", {
secure: true,
rejectUnauthorized: false,
reconnect: true,
forceNew: true,
//agent: agent,
transportOptions: {
polling: {
extraHeaders: HEADERS
}
}
});
}
Example of usage:
var bot = TrollboxSocket();
bot.on('connect', function() {
bot.emit('user joined', 'Bot', '#FFFFFF', '', '', '');
bot.emit('message', 'Hello world!');
});
IF YOU USE THIS CODE TO SPAM, I WILL BE FORCED TO REMOVE THIS BLOG POST
2 CommentsReplacing unnecessary MUL
instructions with ADD
instructions in order to increase performance.
; AX = x1, BX = y1, CX = x2, DX = y2
draw_line:
pusha
mov dword [.pos], 0
mov [.x1], ax ; store values in memory
mov [.y2], bx
mov [.x2], cx
mov [.y1], dx
sub cx, ax
sub dx, bx
mov ax, cx
call to_abs
mov [.w], ax
mov ax, dx
call to_abs
mov [.h], ax
mov ax, [.x1] ; do comparisons to check on which diagonal is the line
mov bx, [.y1]
mov cx, [.x2]
mov dx, [.y2]
sub cx, ax
sub dx, bx
and cx, 1000000000000000b
and dx, 1000000000000000b
cmp cx, dx
je .topleft
mov byte [.dg], 1
jmp .continue1
.topleft:
mov byte [.dg], 2
.continue1:
mov ax, [.x1] ; set values for x and y (top left corner of the rectangle container)
mov bx, [.x2]
call minimum
mov [.x], ax
mov ax, [.y1]
mov bx, [.y2]
call minimum
mov [.y], ax
mov ax, [.w]
mov bx, [.h]
cmp ax, bx
je .diag
jge .horiz
.verti:
mov ax, 0
mov dx, [.w]
div word [.h]
mov [.t], ax
mov bx, 0
.loop1:
cmp bx, [.h]
je .end
mov eax, 0
mov ax, [.t]
add [.pos], eax
mov eax, [.pos]
shr eax, 16
mov dx, ax
cmp byte [.dg], 2
je .chg1
.continue2:
mov cx, dx
mov dx, bx
add cx, [.x]
add dx, [.y]
call draw_pixel
inc bx
jmp .loop1
.chg1:
push ax
mov ax, [.w]
sub ax, dx
mov dx, ax
pop ax
jmp .continue2
.horiz:
mov ax, 0
mov dx, [.h]
div word [.w]
mov [.t], ax
mov bx, 0
.loop2:
cmp bx, [.w]
je .end
mov eax, 0
mov ax, [.t]
add [.pos], eax
mov eax, [.pos]
shr eax, 16
mov dx, ax
cmp byte [.dg], 2
je .chg2
.continue3:
mov cx, bx
add cx, [.x]
add dx, [.y]
call draw_pixel
inc bx
jmp .loop2
.chg2:
push ax
mov ax, [.h]
sub ax, dx
mov dx, ax
pop ax
jmp .continue3
.diag:
mov bx, 0
.loop3:
cmp bx, [.h]
je .end
mov dx, bx
mov cx, bx
cmp byte [.dg], 2
je .chg3
.continue4:
add cx, [.x]
add dx, [.y]
call draw_pixel
inc bx
jmp .loop3
.chg3:
push ax
mov ax, [.h]
sub ax, dx
mov dx, ax
pop ax
jmp .continue4
.end:
popa
ret
.x1 dw 0
.y1 dw 0
.x2 dw 0
.y2 dw 0
.x dw 0
.y dw 0
.w dw 0
.h dw 0
.t dw 0
.dg db 0
.pos dd 0
No CommentThis is a screenshot of a small realtime animation that I'm making with Assembly.
This footage was recorded by random dudes on area 51 raid.
Finally, we have conclusive proof that aliens have indeed visited Earth.