Skip to content

Instantly share code, notes, and snippets.

@TheUltDev
TheUltDev / gist:fb8bd9ef32490234bfe6
Created November 4, 2012 07:49
Syntax - Contest #1: Autofisher
i=0;while(1)do p=Self.Position()x,y=i%15-7+p.x,i%11-5+p.y;wait(getTileUseID(x,y,p.z).id%4597<6 and selfUseItemWithGround(3483,x,y,p.z)and 1E3)i=i+1;end
function parseLuaDoc()
function parseParameters(str)
local params = {}
local pattern = "%-%-%s@param%s(.-)%s(.-)\n"
i = 1
while(true)do
local iStart, iEnd, sName, sDesc = string.find(str, pattern, i)
if(not iStart)then break end
sOptional = (string.find(sDesc, "optional;")) and true or false
-- SynHUD Advanced Configuration
---------------------------------------------------------------------------------------------
-- This config is optional and the HUD will work without it. It just unlocks more features.
-- Place the script in the 'Documents/XenoBot' directory. Not the scripts directory!
-- To enable, set the 'enabled' value to 'true', and edit the values to your desire.
-- If you do not need a certain config, you may delete or disable it.
-- Please post in the thread 'http://forums.xenobot.net/showthread.php?13829' for support.
-- Thanks for your support. Yours truly, Syntax.
---------------------------------------------------------------------------------------------
#!/usr/bin/env node
var WebSocketServer = require('websocket').server;
var http = require('http');
var server = http.createServer(function(request, response) {
console.log((new Date()) + ' Received request for ' + request.url);
response.writeHead(404);
response.end();
});
server.listen(8080, function() {
var WebSocketServer = require('websocket').server;
var http = require('http');
var server = http.createServer(function(request, response) {
console.log((new Date()) + ' Received request for ' + request.url);
response.writeHead(404);
response.end();
});
server.listen(8080, function() {
console.log((new Date()) + ' Server is listening on port 8080');
@TheUltDev
TheUltDev / defensive-driving-userscript.js
Last active September 15, 2015 11:31
Automates some annoying limitations of taking Defensive Driving online.
// ==UserScript==
// @name Defensive Driving
// @namespace http://course.defensivedriving.com
// @version 0.1
// @description automatically wait for too fast time
// @author You
// @match http://course.defensivedriving.com/*
// @grant none
// ==/UserScript==
@TheUltDev
TheUltDev / tfs-lua.sublime-completions
Last active May 9, 2020 11:55
Lua functions for The Forgotten Server. Autocomplete file for Sublime Text 3.
{
"scope": "source.lua",
"completions": [
"ACCOUNT_TYPE_GAMEMASTER",
"ACCOUNT_TYPE_GOD",
"ACCOUNT_TYPE_NORMAL",
"ACCOUNT_TYPE_SENIORTUTOR",
"ACCOUNT_TYPE_TUTOR",
"CALLBACK_PARAM_LEVELMAGICVALUE",
"CALLBACK_PARAM_SKILLVALUE",
local xenohub = IpcPublisherSocket.New('xenohub', 30100)
print('XenoHub listening on port 30100.')
-- Send blue flashing alarm to hue lights
--xenohub:PublishMessage('alarm', '0, 255,0')
Module.New('xenohub', function(mod)
-- Update player in XenoHub's player list
xenohub:PublishMessage('player', string.format('{"id": %d, "name": "%s", "level": %d, "vocation": "Druid", "script": "%s", "state": "%s", "exp": %d, "gold": %d}',
@TheUltDev
TheUltDev / invisible-monster-shooter.lua
Last active November 30, 2015 13:16
Executes an AoE when monsters go invisible
-- Module: Invisible Monster Shooter
-- Description: Executes an AoE when monsters go invisible
-- Version: 2.1.0 (updated 11.30.2015)
-- Created by: Cavitt Glover (Syntax)
-- Table containing every attack configured below
local attack = {}
-- Order attacks by number, 1 being highest priority.
-- eg: exori gran should be a lower number than exori or exori mas.
@TheUltDev
TheUltDev / detect-adblock.js
Created June 12, 2017 16:28
Detect AdBlock
function test(){
var detected = false;
// create the bait
var bait = document.createElement('div');
bait.setAttribute('class', 'pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads text-ad-links');
bait.setAttribute('style', 'width: 1px ! important; height: 1px !important; position: absolute !important; left: -10000px !important; top: -1000px !important;');
window.document.body.appendChild(bait);
// check if the bait has been affected by an adblocker