Skip to content

Instantly share code, notes, and snippets.

@NitroXenon
NitroXenon / InternalLoLTimers
Last active August 29, 2015 14:20 — forked from davidzech/InternalLoLTimers
Curse voice jungle timer
using Coherent.UI.Binding;
using Curse.Companion.Scripting;
using Curse.CurseClient.Shared;
using Curse.Logging;
using Curse.Tools.LoL;
using EasyHook;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@NitroXenon
NitroXenon / README.md
Last active August 29, 2015 14:21 — forked from hallazzang/README.md

How to make LOL(League of Legends) chat bot

  1. Install xmpppy module for python. (Manually download it from Downloads Page or try easy_install xmpppy)
  2. Create a script file. (Ex. lol_echo_bot.py)
  3. Follow steps below.

Import xmpp.

import socket
import struct
import json
def unpack_varint(s):
d = 0
for i in range(5):
b = ord(s.recv(1))
d |= (b & 0x7F) << 7*i
if not b & 0x80:
#!/usr/bin/env python3
"""
Simple script that implements the minecraft protocol
to create a basic chat client for said game.
No encryption, no online mode, no parsing of chat messages.
I tried to make it as extendable as possible, so hack away.
PEP8 Note: Ignored E302 (2 newlines between functions)
"""
@NitroXenon
NitroXenon / gist:2afcebdaeb04185f3e21
Created September 22, 2015 10:58
EasyHookD3D.cs
private List<IntPtr> id3dDeviceFunctionOffsets()
{
Device device;
List<IntPtr> id3dDeviceFunctionAddresses = new List<IntPtr>();
using (Direct3D d3d = new Direct3D())
{
PresentParameters pPars = new PresentParameters();
pPars.BackBufferWidth = 1;
pPars.BackBufferHeight = 1;
pPars.Windowed=true;

#我的 Vim 指令筆記

##vim 的三種模式 ###模式

  • 輸入模式:輸入內文。
  • 指揮模式:也叫指令模式,主要是進入到可以對文件做修改,複製,剪下貼上,游標移動等動作。
  • 執行模式:文件存檔,離開等等行為。

###常用模式的切換

  • 輸入模式 -> 指揮模式 : 鍵盤 Esc
@NitroXenon
NitroXenon / mplayerc.cpp
Created October 26, 2015 01:48
SPlayer start args
while(pos)
{
CString param = cmdln.GetNext(pos);
if(param.IsEmpty()) continue;
if((param[0] == '-' || param[0] == '/') && param.GetLength() > 1)
{
CString sw = param.Mid(1).MakeLower();
if(sw == _T("open")) nCLSwitches |= CLSW_OPEN;
else if(sw == _T("play")) nCLSwitches |= CLSW_PLAY;
@NitroXenon
NitroXenon / replays.md
Created October 26, 2015 01:49 — forked from 1lann/replays.md
Storing and playing back replays in League of Legends

Storing and playing back replays in League of Legends

How it works

When you spectate a game in League of Legends, you tell the client to use a HTTP server, and make HTTP requests to it to retrieve data in chunks which make up a game. But what if you could return back the exact same data at a later time, simulating the spectate but viewing it at anytime? That's the concept behind replays and that's how they work.

There is some behavior in the API which I do not fully understand yet, so there are if statements to catch these edge cases.

Current game information

Before you can even get the game's metadata, you'll need to retrieve necessary information for the game. This call is part of the official Riot Games API.

/observer-mode/rest/consumer/getSpectatorGameInfo/{platformId}/{summonerId}

@NitroXenon
NitroXenon / intercept-https-with-python-mitmproxy.md
Created November 17, 2015 08:28 — forked from dannvix/intercept-https-with-python-mitmproxy.md
Intercept and manipulate HTTPs traffic with Python and mitmproxy

Intercepts HTTPs Traffic with Python & mitmproxy

Introduction

Modern applications usually make use of back-end API servers to provide their services. With a non-transparent HTTPs proxy, which intercepts the communication between clients and servers (aka the man-in-the-middle scheme), you can easily manipulate both API requests and responses.

This manual helps you create your own proxy with Python and mitmproxy/libmproxy. Mitmproxy ships with both a standalone command-line tool (mitmproxy) and a Python library (libmproxy).

@NitroXenon
NitroXenon / gci-rpi-camera.py
Created December 9, 2015 08:58
gci-rpi-camera.py
import picamera
import time;
camera = picamera.PiCamera()
for i in range(0,10) :
camera.capture('imgae' + str(i+1) + '.jpg')
time.sleep(5)
print 'Finished'