Skip to content

Instantly share code, notes, and snippets.

@Choonster
Choonster / StealthMusic_Core.lua
Created August 30, 2012 15:34
A WoW AddOn that plays music when you're stealthed and moving.
-- Declare a local variable called something like IS_PLAYING (we use this a bit later) and set it to false.
-- Create a frame
-- Hide it
-- Register whatever event(s) fire when the player enters/leaves stealth
-- Set its OnEvent script to show the frame when the player enters stealth (allowing its OnUpdate script to run) and hide the frame, stop the music and set IS_PLAYING to false when the player leaves stealth (stopping its OnUpdate script from running).
-- Set its OnUpdate script to check the player's speed every 0.X seconds.
-- If the player is moving and IS_PLAYING is false, use PlayMusic to start your music and set IS_PLAYING to true.
-- If the player isn't moving and IS_PLAYING is true, use StopMusic to stop the music and set IS_PLAYING to false.
-- http://us.battle.net/wow/en/forum/topic/6412105149#4
@Choonster
Choonster / core.lua
Created September 21, 2012 15:54
BulkBuy version 1.02
--[[
The MIT License
Copyright (c) 2012 Choonster
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@Choonster
Choonster / TillersQuests.lua
Created October 12, 2012 10:32
A Lua script for WoW that tells you which Tillers you still need to feed today.
--[[
Copyright (C) 2012 Choonster
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE O
@Choonster
Choonster / randomSounds.lua
Created December 4, 2012 15:06
A WoW script that provides two functions to play a random sound from a list.
local soundFiles = { -- These are example files only
"Sound\\Creature\\SomeCreature\\SomeCreature_Aggro01.ogg",
"Sound\\Creature\\OtherThing\\OtherThing_Greeting01.ogg"
"Interface\\AddOns\\MyAddOn\\Sounds\\levelup1.ogg"
}
local numSounds = #soundFiles -- Get the number of entries in the soundFiles table
local function PlayRandomSound()
local index = random(1, numSounds) -- Generate a random number between 1 and numSounds to use as an index. random is an alias of the math.random function
@Choonster
Choonster / FocusSequence.toc
Last active December 14, 2015 04:19
A WoW AddOn to sequence your focus between arena enemies.
## Interface: 50001
## Title: FocusSequence
## Author: Choonster
## Notes: Sequences your focus between arena enemies.
## Version: 1.0
core.lua
@Choonster
Choonster / PetDataCollectorOutput.lua
Last active December 14, 2015 06:59
The SavedVariables output of PetDataCollector: http://us.battle.net/wow/en/forum/topic/6794350818#13
PET_DATA = {
[255] = {
["description"] = "Breanni in Dalaran, one of the world's foremost collectors of exotic pets, will only award the mystical Celestial Dragon to fellow collectors whose obsession rivals her own.",
["petType"] = 2,
["abilities"] = {
{
["type"] = 2,
["name"] = "Breath",
["id"] = 115,
["level"] = 1,
@Choonster
Choonster / npp.lua
Created March 1, 2013 20:51
Notepad++ style lexer theme for Scintillua
-- Notepad++ lexer theme for Scintillua.
-- Based on scite lexer theme by Mitchell mitchell.att.foicica.com
local l, color, style = lexer, lexer.color, lexer.style
l.colors = {
black = color('00', '00', '00'),
green = color('00', '80', '00'),
maroon = color("95", "00", "4A"),
brown = color("80", "40", "00"),
This file has been truncated, but you can view the full file.
{
"realm":{"name":"Nagrand","slug":"nagrand"},
"alliance":{"auctions":[
{"auc":431703515,"item":82179,"owner":"Sprykar","bid":653600,"buyout":688000,"quantity":1,"timeLeft":"LONG","rand":-45,"seed":53478102},
{"auc":431683607,"item":40675,"owner":"Erendia","bid":232750,"buyout":245000,"quantity":1,"timeLeft":"LONG","rand":0,"seed":1427349376},
{"auc":432519150,"item":52194,"owner":"Noobiest","bid":33714,"buyout":35489,"quantity":1,"timeLeft":"VERY_LONG","rand":0,"seed":2336327296},
{"auc":432533279,"item":53010,"owner":"???","bid":495000,"buyout":500000,"quantity":20,"timeLeft":"VERY_LONG","rand":0,"seed":185510528},
{"auc":433026846,"item":74247,"owner":"Ankhjunior","bid":398100,"buyout":441350,"quantity":1,"timeLeft":"VERY_LONG","rand":0,"seed":801347648},
{"auc":432930882,"item":83802,"owner":"Mozgov","bid":8288999,"buyout":8288999,"quantity":1,"timeLeft":"LONG","rand":0,"seed":1298038400},
@Choonster
Choonster / page
Created April 23, 2013 04:08
User:Coonster_TheMage on Wowpedia
{{PC|name=Choonster|realm=Frostmourne|loc=US|wwuser=Choonster}}
{{rpbox
| faction = Alliance
| name = Choonster
| image = ChoonsterDwarf.jpg
| guild = Corvus Canis>, formerly <Durotar NOOB Patrol
| realm = Frostmourne US
| title = the Insane
| gender = Male
@Choonster
Choonster / CalculateAverageItemLevel.lua
Last active December 19, 2015 01:48
A WoW script snippet that shows how to calculate the average item level of a unit. Call RequestAverageItemLevel with a unitID to request inspect data for the unit and calculate the unit's average item level once that data is available. The results are printed to chat. This hasn't been tested, so please notify me if it doesn't work.
local SPECID_FURY = 72 -- Fury's specialisation ID, as returned by GetInspectSpecialization
-- Calculate and return a unit's average item level using the formula described on this page:
-- http://www.wowpedia.org/API_GetAverageItemLevel
-- Should only be called after INSPECT_READY fired for the unit
local function CalculateAverageItemLevel(unit)
local totalIlvl = 0
local mainHandEquipLoc, offHandEquipLoc
for slot = INVSLOT_FIRST_EQUIPPED, INVSLOT_LAST_EQUIPPED do -- For every slot,