Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vl = {
- current_hudtxt2_id = 21,
- buttonstyles = {
- [1] = {
- name = "Windows 7",
- patch = "gfx/_AlcatrazZ/Lua/Visual Lua/button_windows7.png",
- xsize = 160,
- ysize = 21,
- txtcolor = "080080080",
- patch_hover = "gfx/_AlcatrazZ/Lua/Visual Lua/buttonhover_windows7.png",
- patch_click = "gfx/_AlcatrazZ/Lua/Visual Lua/buttonclick_windows7.png"
- },
- [2] = {
- name = "Windows 8",
- patch = "gfx/_AlcatrazZ/Lua/Visual Lua/button_windows8.png",
- xsize = 160,
- ysize = 21,
- txtcolor = "080080080",
- patch_hover = "gfx/_AlcatrazZ/Lua/Visual Lua/buttonhover_windows8.png",
- patch_click = "gfx/_AlcatrazZ/Lua/Visual Lua/buttonclick_windows8.png"
- },
- [3] = {
- name = "Windows 8 close",
- patch = "gfx/_AlcatrazZ/Lua/Visual Lua/close_windows8.png",
- xsize = 32,
- ysize = 20,
- txtcolor = "080080080",
- patch_hover = "gfx/_AlcatrazZ/Lua/Visual Lua/closehover_windows8.png",
- patch_click = "gfx/_AlcatrazZ/Lua/Visual Lua/closeclick_windows8.png"
- },
- [4] = {
- name = "Minecraf Craft",
- patch = "gfx/_AlcatrazZ/Lua/Minecraft/craftbutton_minecraft.png",
- xsize = 80,
- ysize = 32,
- txtcolor = "080080080",
- patch_hover = "gfx/_AlcatrazZ/Lua/Minecraft/craftbuttonhover_minecraft.png",
- patch_click = "gfx/_AlcatrazZ/Lua/Minecraft/craftbuttonclick_minecraft.png"
- }
- },
- windowstyles = {
- [1] = {
- name = "Windows 7",
- patch = "gfx/_AlcatrazZ/Lua/Visual Lua/window_windows7.png",
- xsize = 207,
- ysize = 317,
- txtcolor = "080080080",
- ox = -90,
- oy = -150
- },
- [2] = {
- name = "Windows 8",
- patch = "gfx/_AlcatrazZ/Lua/Visual Lua/window_windows8.png",
- xsize = 207,
- ysize = 317,
- txtcolor = "070140170",
- ox = -90,
- oy = -150
- },
- [3] = {
- name = "Minecraft Inventory",
- patch = "gfx/_AlcatrazZ/Lua/Minecraft/window_inventory.png",
- xsize = 352,
- ysize = 332,
- txtcolor = "080080080",
- ox = -90,
- oy = -150
- }
- },
- slotstyles = {
- [1] = {
- name = "Minecraft slot",
- patch = "gfx/_AlcatrazZ/Lua/Minecraft/slot_minecraft.png",
- xsize = 36,
- ysize = 36,
- txtcolor = "255255255",
- patch_hover = "gfx/_AlcatrazZ/Lua/Minecraft/slothover_minecraft.png",
- patch_select = "gfx/_AlcatrazZ/Lua/Minecraft/slotselect_minecraft.png",
- ox = 0,
- oy = 8
- }
- },
- items = {
- [1] = {
- name = "Dirt",
- patch = "gfx/_AlcatrazZ/Lua/Minecraft/items/1.png",
- stack = 64
- },
- [2] = {
- name = "Stone",
- patch = "gfx/_AlcatrazZ/Lua/Minecraft/items/2.png",
- stack = 64
- }
- },
- crafts = {
- [1] = {
- 2,
- 2,
- false,
- 2
- },
- [2] = {
- 1,
- 1,
- 1,
- 1
- }
- }
- }
- vl.hook = {}
- vl.user = {}
- function vl.hook.join(id)
- if player(id, "bot") then
- return
- end
- vl.user[id] = {
- buttons = {},
- windows = {},
- slots = {},
- hudtxt2ids = {}
- }
- end
- function vl.hook.leave(id)
- if player(id, "bot") then
- return
- end
- vl.user[id] = nil
- end
- function vl.hook.startround()
- for _, id in pairs(player(0, "table")) do
- if player(id, "bot") then
- return
- end
- end
- end
- function vl.hook.clientdata(id, mode, x, y)
- if player(id, "bot") then
- return
- end
- if mode == 0 and vl.user[id] then
- vl.user[id].screenx = x
- vl.user[id].screeny = y
- end
- end
- function vl.hook.ms100()
- for _, id in pairs(player(0, "table")) do
- if player(id, "bot") then
- return
- end
- if vl.user[id] then
- vl.ButtonHover(id)
- vl.SlotHover(id)
- end
- end
- end
- function vl.hook.attack(id)
- if player(id, "bot") then
- return
- end
- vl.ButtonClick(id)
- vl.SlotClick(id)
- end
- function vl.CreateButton(id, buttonid, x, y, style, func)
- if not vl.user[id].buttons[buttonid] then
- vl.user[id].buttons[buttonid] = {
- imageid = image(vl.buttonstyles[style].patch, x, y, 2, id),
- style = style,
- func = func,
- x = x,
- y = y,
- textids = {}
- }
- else
- vl.Error("button " .. buttonid .. " of player " .. id .. " already exists")
- end
- end
- function vl.RemoveButton(id, buttonid)
- if vl.user[id].buttons[buttonid] then
- vl.user[id].buttoninrange = nil
- vl.RemoveText(id, "button", buttonid)
- freeimage(vl.user[id].buttons[buttonid].imageid)
- vl.user[id].buttons[buttonid] = nil
- if vl.user[id].buttonhover then
- freeimage(vl.user[id].buttonhover)
- vl.user[id].buttonhover = nil
- end
- end
- end
- function vl.ButtonHover(id)
- if vl.user[id] then
- if vl.user[id].screenx == nil then
- vl.user[id].screenx = 0
- end
- if vl.user[id].screeny == nil then
- vl.user[id].screeny = 0
- end
- for _, i in pairs(vl.user[id].buttons) do
- local xsize = vl.buttonstyles[vl.user[id].buttons[_].style].xsize
- local ysize = vl.buttonstyles[vl.user[id].buttons[_].style].ysize
- if not vl.user[id].buttoninrange then
- if vl.user[id].screenx >= i.x - xsize / 2 and vl.user[id].screeny >= i.y - ysize / 2 and vl.user[id].screenx <= i.x + xsize / 2 and vl.user[id].screeny <= i.y + ysize / 2 then
- if vl.buttonstyles[vl.user[id].buttons[_].style].patch_hover then
- vl.user[id].buttonhover = image(vl.buttonstyles[vl.user[id].buttons[_].style].patch_hover, i.x, i.y, 2, id)
- end
- vl.user[id].buttoninrange = _
- end
- elseif (vl.user[id].screenx <= i.x - xsize / 2 or vl.user[id].screeny <= i.y - ysize / 2 or vl.user[id].screenx >= i.x + xsize / 2 or vl.user[id].screeny >= i.y + ysize / 2) and vl.user[id].buttoninrange == _ then
- if vl.buttonstyles[vl.user[id].buttons[_].style].patch_hover then
- freeimage(vl.user[id].buttonhover)
- vl.user[id].buttonhover = nil
- end
- vl.user[id].buttoninrange = nil
- end
- end
- reqcld(id, 0)
- end
- end
- function vl.ButtonClick(id)
- if vl.user[id].buttoninrange and not vl.user[id].buttonclicked then
- if vl.buttonstyles[vl.user[id].buttons[vl.user[id].buttoninrange].style].patch_click then
- vl.user[id].buttonclick = image(vl.buttonstyles[vl.user[id].buttons[vl.user[id].buttoninrange].style].patch_click, vl.user[id].buttons[vl.user[id].buttoninrange].x, vl.user[id].buttons[vl.user[id].buttoninrange].y, 2, id)
- end
- vl.user[id].buttonclicked = true
- timer(100, "parse", "lua vl.ButtonUnclick(" .. id .. "," .. vl.user[id].buttoninrange .. ")")
- end
- end
- function vl.ButtonUnclick(id, buttonid)
- vl.user[id].buttonclicked = false
- if vl.user[id].buttonclick then
- freeimage(vl.user[id].buttonclick)
- vl.user[id].buttonclick = nil
- end
- if vl.user[id].buttons[buttonid] and vl.user[id].buttons[buttonid].func then
- vl.user[id].buttons[buttonid].func(id, vl.user[id].slotselected)
- end
- end
- function vl.CreateWindow(id, windowid, x, y, style, headline)
- if not vl.user[id].windows[windowid] then
- vl.user[id].windows[windowid] = {
- imageid = image(vl.windowstyles[style].patch, x, y, 2, id),
- style = style,
- x = x,
- y = y,
- textids = {}
- }
- if headline ~= nil and headline ~= "" then
- vl.CreateText(id, "window", windowid, style, x + vl.windowstyles[style].ox, y + vl.windowstyles[style].oy, headline, 0, nil, true)
- end
- end
- end
- function vl.RemoveWindow(id, windowid)
- if vl.user[id].windows[windowid] then
- vl.RemoveText(id, "window", windowid)
- freeimage(vl.user[id].windows[windowid].imageid)
- vl.user[id].windows[windowid] = nil
- end
- end
- function vl.CreateSlot(id, invid, slotid, x, y, style, showamount, morethanone, hoveroveritem)
- showamount = showamount or false
- if not vl.user[id].slots[invid] then
- vl.user[id].slots[invid] = {}
- end
- if not vl.user[id].slots[invid][slotid] then
- vl.user[id].slots[invid][slotid] = {
- imageid = image(vl.slotstyles[style].patch, x, y, 2, id),
- itemid = nil,
- visible = true,
- style = style,
- x = x,
- y = y,
- item = false,
- amount = 0,
- showamount = showamount,
- morethanone = morethanone,
- hoveroveritem = hoveroveritem,
- textids = {}
- }
- end
- end
- function vl.ShowSlot(id, invid, slotid)
- if vl.user[id].slots[invid][slotid] and not vl.user[id].slots[invid][slotid].visible then
- vl.user[id].slots[invid][slotid].imageid = image(vl.slotstyles[vl.user[id].slots[invid][slotid].style].patch, vl.user[id].slots[invid][slotid].x, vl.user[id].slots[invid][slotid].y, 2, id)
- vl.user[id].slots[invid][slotid].visible = true
- if vl.user[id].slots[invid][slotid].item then
- vl.user[id].slots[invid][slotid].itemid = image(vl.items[vl.user[id].slots[invid][slotid].item].patch, vl.user[id].slots[invid][slotid].x, vl.user[id].slots[invid][slotid].y, 2, id)
- if vl.user[id].slots[invid][slotid].showamount then
- if vl.user[id].slots[invid][slotid].morethanone then
- if vl.user[id].slots[invid][slotid].amount > 1 then
- vl.CreateText(id, "slot", slotid, vl.user[id].slots[invid][slotid].style, vl.user[id].slots[invid][slotid].x + vl.slotstyles[vl.user[id].slots[invid][slotid].style].ox, vl.user[id].slots[invid][slotid].y + vl.slotstyles[vl.user[id].slots[invid][slotid].style].oy, vl.user[id].slots[invid][slotid].amount, 1, invid)
- end
- else
- vl.CreateText(id, "slot", slotid, vl.user[id].slots[invid][slotid].style, vl.user[id].slots[invid][slotid].x + vl.slotstyles[vl.user[id].slots[invid][slotid].style].ox, vl.user[id].slots[invid][slotid].y + vl.slotstyles[vl.user[id].slots[invid][slotid].style].oy, vl.user[id].slots[invid][slotid].amount, 1, invid)
- end
- end
- end
- end
- end
- function vl.HideSlot(id, invid, slotid)
- if vl.user[id].slots[invid][slotid] and vl.user[id].slots[invid][slotid].visible then
- vl.RemoveText(id, "slot", slotid, invid)
- vl.user[id].slotinrange = nil
- vl.user[id].invinrange = nil
- vl.RemoveText(id, "slot", slotid, invid)
- freeimage(vl.user[id].slots[invid][slotid].imageid)
- vl.user[id].slots[invid][slotid].imageid = nil
- if vl.user[id].slots[invid][slotid].itemid then
- freeimage(vl.user[id].slots[invid][slotid].itemid)
- vl.user[id].slots[invid][slotid].itemid = nil
- end
- vl.user[id].slots[invid][slotid].visible = false
- if vl.user[id].slothover then
- freeimage(vl.user[id].slothover)
- vl.user[id].slothover = nil
- end
- if vl.user[id].selectedid then
- freeimage(vl.user[id].selectedid)
- vl.user[id].selectedinv = false
- vl.user[id].selectedslot = false
- end
- end
- end
- function vl.RemoveSlot(id, invid, slotid)
- if vl.user[id].slots[invid][slotid] then
- vl.user[id].slotinrange = nil
- vl.user[id].invinrange = nil
- vl.RemoveText(id, "slot", slotid, invid)
- freeimage(vl.user[id].slots[invid][slotid].imageid)
- if vl.user[id].slots[invid][slotid].itemid then
- freeimage(vl.user[id].slots[invid][slotid].itemid)
- vl.user[id].slots[invid][slotid].itemid = nil
- end
- vl.user[id].slots[invid][slotid] = nil
- if vl.user[id].slothover then
- freeimage(vl.user[id].slothover)
- vl.user[id].slothover = nil
- end
- if vl.user[id].selectedid then
- freeimage(vl.user[id].selectedid)
- vl.user[id].selectedinv = false
- vl.user[id].selectedslot = false
- end
- end
- end
- function vl.SlotHover(id)
- if vl.user[id] then
- if vl.user[id].screenx == nil then
- vl.user[id].screenx = 0
- end
- if vl.user[id].screeny == nil then
- vl.user[id].screeny = 0
- end
- for k, v in pairs(vl.user[id].slots) do
- for _, i in pairs(vl.user[id].slots[k]) do
- if vl.user[id].slots[k][_].visible and vl.slotstyles[vl.user[id].slots[k][_].style].patch_hover then
- local xsize = vl.slotstyles[vl.user[id].slots[k][_].style].xsize
- local ysize = vl.slotstyles[vl.user[id].slots[k][_].style].ysize
- if not vl.user[id].slothover then
- if vl.user[id].screenx >= i.x - xsize / 2 and vl.user[id].screeny >= i.y - ysize / 2 and vl.user[id].screenx <= i.x + xsize / 2 and vl.user[id].screeny <= i.y + ysize / 2 then
- if not vl.user[id].slots[k][_].hoveroveritem then
- if vl.user[id].slots[k][_].itemid then
- freeimage(vl.user[id].slots[k][_].itemid)
- vl.user[id].slothover = image(vl.slotstyles[vl.user[id].slots[k][_].style].patch_hover, i.x, i.y, 2, id)
- vl.user[id].slots[k][_].itemid = image(vl.items[vl.user[id].slots[k][_].item].patch, vl.user[id].slots[k][_].x, vl.user[id].slots[k][_].y, 2, id)
- imagescale(vl.user[id].slots[k][_].itemid, 0.8, 0.8)
- else
- vl.user[id].slothover = image(vl.slotstyles[vl.user[id].slots[k][_].style].patch_hover, i.x, i.y, 2, id)
- end
- else
- vl.user[id].slothover = image(vl.slotstyles[vl.user[id].slots[k][_].style].patch_hover, i.x, i.y, 2, id)
- end
- vl.user[id].slotinrange = _
- vl.user[id].invinrange = k
- end
- elseif (vl.user[id].screenx <= i.x - xsize / 2 or vl.user[id].screeny <= i.y - ysize / 2 or vl.user[id].screenx >= i.x + xsize / 2 or vl.user[id].screeny >= i.y + ysize / 2) and vl.user[id].slotinrange == _ and vl.user[id].invinrange == k then
- freeimage(vl.user[id].slothover)
- vl.user[id].slothover = nil
- vl.user[id].slotinrange = nil
- vl.user[id].invinrange = nil
- end
- end
- end
- end
- reqcld(id, 0)
- end
- end
- function vl.SlotClick(id)
- if vl.user[id].invinrange and vl.user[id].slotinrange and not vl.user[id].slotclicked then
- if vl.slotstyles[vl.user[id].slots[vl.user[id].invinrange][vl.user[id].slotinrange].style].patch_click then
- vl.user[id].slotclick = image(vl.slotstyles[vl.user[id].slots[vl.user[id].invinrange][vl.user[id].slotinrange].style].patch_click, vl.user[id].slots[vl.user[id].invinrange][vl.user[id].slotinrange].x, vl.user[id].slots[vl.user[id].invinrange][vl.user[id].slotinrange].y, 2, id)
- end
- vl.user[id].slotclicked = true
- timer(100, "parse", "lua vl.SlotUnclick(" .. id .. "," .. vl.user[id].invinrange .. "," .. vl.user[id].slotinrange .. ")")
- end
- end
- function vl.SlotUnclick(id, invid, slotid)
- vl.user[id].slotclicked = false
- if vl.user[id].slotclick then
- freeimage(vl.user[id].slotclick)
- vl.user[id].slotclick = nil
- end
- vl.SlotSelect(id, invid, slotid)
- end
- function vl.SlotSelect(id, invid, slotid)
- if vl.user[id].selectedinv and vl.user[id].selectedslot then
- freeimage(vl.user[id].selectedid)
- vl.user[id].selectedid = nil
- if invid ~= vl.user[id].selectedinv or slotid ~= vl.user[id].selectedslot then
- local x = vl.AddItem(id, invid, slotid, vl.user[id].slots[vl.user[id].selectedinv][vl.user[id].selectedslot].item, vl.user[id].slots[vl.user[id].selectedinv][vl.user[id].selectedslot].amount)
- if x == "remove" then
- vl.RemoveItem(id, vl.user[id].selectedinv, vl.user[id].selectedslot, vl.user[id].slots[vl.user[id].selectedinv][vl.user[id].selectedslot].item)
- elseif type(x) == "number" then
- vl.RemoveItem(id, vl.user[id].selectedinv, vl.user[id].selectedslot, vl.user[id].slots[vl.user[id].selectedinv][vl.user[id].selectedslot].item, x)
- end
- end
- vl.user[id].selectedinv = false
- vl.user[id].selectedslot = false
- else
- vl.user[id].selectedinv = invid
- vl.user[id].selectedslot = slotid
- vl.user[id].selectedid = image(vl.slotstyles[vl.user[id].slots[invid][slotid].style].patch_select, vl.user[id].slots[invid][slotid].x, vl.user[id].slots[invid][slotid].y, 2, id)
- end
- end
- function vl.AddItem(id, invid, slotid, item, amount)
- local amount = amount or 1
- if vl.user[id].slots[invid] then
- if vl.user[id].slots[invid][slotid] then
- if vl.user[id].slots[invid][slotid].item then
- if vl.user[id].slots[invid][slotid].item == item then
- if vl.items[item].stack >= vl.user[id].slots[invid][slotid].amount + amount then
- vl.user[id].slots[invid][slotid].amount = vl.user[id].slots[invid][slotid].amount + amount
- if vl.user[id].slots[invid][slotid].visible then
- vl.HideSlot(id, invid, slotid)
- vl.ShowSlot(id, invid, slotid)
- end
- return "remove"
- else
- local x = vl.user[id].slots[invid][slotid].amount
- if amount < x and x < vl.items[item].stack then
- vl.user[id].slots[invid][slotid].amount = vl.items[item].stack
- if vl.user[id].slots[invid][slotid].visible then
- vl.HideSlot(id, invid, slotid)
- vl.ShowSlot(id, invid, slotid)
- end
- return vl.items[item].stack - x
- end
- end
- end
- elseif item and amount <= vl.items[item].stack then
- vl.user[id].slots[invid][slotid].item = item
- vl.user[id].slots[invid][slotid].amount = amount
- if vl.user[id].slots[invid][slotid].visible then
- vl.HideSlot(id, invid, slotid)
- vl.ShowSlot(id, invid, slotid)
- end
- return "remove"
- end
- else
- local emptySlot = vl.getEmpty(id, invid, slotid, item, amount)
- if emptySlot then
- if vl.user[id].slots[invid][emptySlot].item then
- vl.user[id].slots[invid][emptySlot].amount = vl.user[id].slots[invid][emptySlot].amount + amount
- if vl.user[id].slots[invid][emptySlot].visible then
- vl.HideSlot(id, invid, emptySlot)
- vl.ShowSlot(id, invid, emptySlot)
- end
- return "remove"
- elseif amount <= vl.items[item].stack then
- vl.user[id].slots[invid][emptySlot].item = item
- vl.user[id].slots[invid][emptySlot].amount = amount
- if vl.user[id].slots[invid][emptySlot].visible then
- vl.HideSlot(id, invid, emptySlot)
- vl.ShowSlot(id, invid, emptySlot)
- end
- return "remove"
- end
- end
- end
- end
- return false
- end
- function vl.RemoveItem(id, invid, slotid, item, amount)
- if vl.user[id].slots[invid] and vl.user[id].slots[invid][slotid] then
- local amount = amount or vl.user[id].slots[invid][slotid].amount
- if vl.user[id].slots[invid][slotid].item and vl.user[id].slots[invid][slotid].item == item then
- if amount < vl.user[id].slots[invid][slotid].amount then
- vl.user[id].slots[invid][slotid].amount = vl.user[id].slots[invid][slotid].amount - amount
- if vl.user[id].slots[invid][slotid].visible then
- vl.HideSlot(id, invid, slotid)
- vl.ShowSlot(id, invid, slotid)
- end
- elseif vl.user[id].slots[invid][slotid].amount == amount then
- vl.user[id].slots[invid][slotid].amount = 0
- vl.user[id].slots[invid][slotid].item = false
- freeimage(vl.user[id].slots[invid][slotid].itemid)
- vl.user[id].slots[invid][slotid].itemid = nil
- if vl.user[id].slots[invid][slotid].visible then
- vl.HideSlot(id, invid, slotid)
- vl.ShowSlot(id, invid, slotid)
- end
- end
- end
- end
- end
- function vl.getItemPatch(itemid)
- if vl.items[itemid] then
- return vl.items[itemid].patch
- end
- return false
- end
- function vl.getEmpty(id, invid, slotid, item, amount)
- if not slotid then
- for _, i in pairs(vl.user[id].slots[invid]) do
- if i.item then
- if i.item == item and vl.items[i.item].stack >= i.amount + amount then
- return _
- end
- else
- return _
- end
- end
- elseif vl.user[id].slots[invid][slotid].item then
- if vl.user[id].slots[invid][slotid].item == item and vl.items[vl.user[id].slots[invid][slotid].item].stack >= vl.user[id].slots[invid][slotid].amount + amount then
- return slotid
- end
- else
- return slotid
- end
- return false
- end
- function vl.CreateText(id, b, typeid, style, x, y, txt, align, invid, header)
- local a, a2
- if b == "button" then
- a = vl.user[id].buttons[typeid].textids
- a2 = vl.buttonstyles[style]
- elseif b == "window" then
- a = vl.user[id].windows[typeid].textids
- a2 = vl.windowstyles[style]
- elseif b == "slot" then
- a = vl.user[id].slots[invid][typeid].textids
- a2 = vl.slotstyles[style]
- end
- local tid = vl.getTextID(id)
- if b == "button" then
- parse("hudtxt2 " .. id .. " " .. tid .. " \"" .. "\169" .. a2.txtcolor .. txt .. "\" " .. x .. " " .. y - 8 .. " " .. align)
- elseif b == "window" then
- if not header or header == 0 then
- parse("hudtxt2 " .. id .. " " .. tid .. " \"" .. "\169" .. a2.txtcolor .. txt .. "\" " .. x .. " " .. y - 8 .. " " .. align)
- else
- parse("hudtxt2 " .. id .. " " .. tid .. " \"" .. "\169" .. a2.txtcolor .. txt .. "\" " .. x .. " " .. y .. " " .. align)
- end
- elseif b == "slot" then
- parse("hudtxt2 " .. id .. " " .. tid .. " \"" .. "\169" .. a2.txtcolor .. txt .. "\" " .. x .. " " .. y - 8 .. " " .. align)
- end
- table.insert(vl.user[id].hudtxt2ids, tid)
- table.insert(a, tid)
- end
- function vl.RemoveText(id, b, typeid, invid)
- local a
- if b == "button" then
- a = vl.user[id].buttons[typeid].textids
- elseif b == "window" then
- a = vl.user[id].windows[typeid].textids
- elseif b == "slot" then
- a = vl.user[id].slots[invid][typeid].textids
- end
- if a[1] then
- for _, i in pairs(a) do
- parse("hudtxt2 " .. id .. " " .. i .. " \" \" 0 0 0")
- vl.tableRemove(vl.user[id].hudtxt2ids, i)
- vl.tableRemove(a, i)
- end
- end
- end
- function vl.tableRemove(tab, value)
- for _, i in pairs(tab) do
- if i == value then
- table.remove(tab, _)
- end
- end
- end
- function vl.getTextID(id)
- local txtid = vl.current_hudtxt2_id
- while vl.FindTextID(id, txtid) do
- txtid = txtid + 1
- end
- return txtid
- end
- function vl.FindTextID(id, tid)
- if vl.user[id].hudtxt2ids[1] then
- for _, i in pairs(vl.user[id].hudtxt2ids) do
- if i == tid then
- return true
- end
- end
- end
- return false
- end
- function vl.RemoveEngine(id)
- for i in pairs(vl.user[id].buttons) do
- vl.RemoveButton(id, i)
- end
- for i in pairs(vl.user[id].windows) do
- vl.RemoveWindow(id, i)
- end
- for i in pairs(vl.user[id].slots) do
- vl.DeleteSlot(id, i)
- end
- end
- function vl.Error(txt)
- print("\169255000000Visual Lua ERROR: " .. txt)
- end
- function vl.addhooks()
- for i in pairs(vl.hook) do
- addhook(tostring(i), "vl.hook." .. tostring(i), -3)
- end
- end
- vl.addhooks()
- print("\169000255000Successfully loaded Visual Lua!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement