XenoBot Forums - Powered by vBulletin

User Tag List

Results 1 to 10 of 60

Thread: [Update] XenoBot v2.5.3 [Scriptable HUD]

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Lifetime Subscriber
    Join Date
    Dec 2011
    Posts
    994
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Spectrus View Post
    @soul4soul, what's your script look like? Try mine!

    [highlight=lua]
    local lootList = {"gold coin","blood herb"}

    local lootIcons = {}
    local lootCounts = {}
    for x = 1, #lootList do
    lootIcons[x] = HUD.CreateItemDisplay(10, x * 32, Item.GetID(lootList[x]), 32, math.min(Self.ItemCount(Item.GetID(lootList[x])), 100))
    lootCounts[x] = HUD.CreateTextDisplay(26, x * 32 + 20, Self.ItemCount(Item.GetID(lootList[x])), 200, 200, 200)
    end
    local ElapsedTime = HUD.CreateTextDisplay(10, 15, "Elapsed Time: ", 200, 200, 200)
    local time = os.clock()

    while true do
    wait(500)
    ElapsedTime:SetText(string.format("Elapsed Time: %.2d:%.2d:%.2d", math.floor(os.difftime(os.clock(), time) / 3600), math.floor(os.difftime(os.clock(), time) / 60) - math.floor(os.difftime(os.clock(), time) / 3600) * 60, os.difftime(os.clock(), time) - math.floor(os.difftime(os.clock(), time) / 60) * 60 - math.floor(os.difftime(os.clock(), time) / 3600) * 3600))
    for x = 1, #lootList do
    lootIcons[x]:SetItemCount(math.min(Self.ItemCount(Item.GetID(l ootList[x])), 100))
    lootCounts[x]:SetText(Self.ItemCount(Item.GetID(lootList[x])))
    end
    end
    [/highlight]
    everything is the same except I didnt include the time,I dont change the item count of the icon, and you have a more clever approach when spacing the icons.
    [highlight=lua]local items= {3031, 10196, 11479, 11477, 11452, 11478, 11453, 11480, 3725, 3244, 3369, 3072, 3091}
    local counts = {}
    local hudtexts = {}
    local movedown = 15
    for i=1, #items do
    HUD.CreateItemDisplay(1, movedown, items[i], 32, 100)
    counts[i] = 0
    movedown = movedown + 32
    hudtexts[i] = HUD.CreateTextDisplay(1, movedown - 14, counts[i], 255, 120, 120)
    end

    while (true) do
    for i=1, #items do
    counts[i] = Self.ItemCount(items[i])
    hudtexts[i]:SetText(counts[i])
    end
    wait(1000)
    end[/highlight]
    The biggest problem I see is for the time being the loot counters will be bound to waypoint scripts. Which doesnt make them easily exportable especially for those who really dont understand how to script. Using the waypoints we can turn on/off the loot counter when entering town and record the values to a second counter and add the 2 for a total which we can display out. To get the number of supplies used we can see how many potions are bought from the NPC each time you go to refill. I havent figured out a good way to count raw gp yet.

    EDIT: hmm can we access variables between lua scripts?
    Last edited by soul4soul; 07-16-2012 at 01:32 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •