那個哦..- function do_prompt (name, line, wildcards)
- local hpString = wildcards [1];
- local hp , max_hp = tonumber (wildcards [2]), tonumber (wildcards [3])
- local ginString = wildcards [4];
- local gin , max_gin = tonumber (wildcards [5]), tonumber (wildcards [6])
- local keeString = wildcards [7];
- local kee , max_kee = tonumber (wildcards [8]), tonumber (wildcards [9])
- local senString = wildcards [10];
- local sen , max_sen = tonumber (wildcards [11]), tonumber (wildcards [12])
- local foodString = wildcards [13];
- local food , max_food = tonumber (wildcards [14]), tonumber (wildcards [15])
- local waterString = wildcards [16];
- local water , max_water = tonumber (wildcards [17]), tonumber (wildcards [18])
- local tireString = wildcards [19];
- local tire , max_tire = tonumber (wildcards [20]), tonumber (wildcards [21])
- if max_kee == 0 then max_kee = 9999999 end
- local hp_th = tonumber (GetVariable ("hp_threshold"))
- local gin_th = tonumber (GetVariable("gin_threshold"))
- local kee_th = tonumber (GetVariable("kee_threshold"))
- local sen_th = tonumber (GetVariable("sen_threshold"))
- --Note(hp_th .. " " .. gin_th .. " " .. kee_th .. " " .. sen_th)
- if hp_th == nil then hp_th = max_hp end
- if gin_th == nil then gin_th = max_gin end
- if kee_th == nil then kee_th = max_kee end
- if sen_th == nil then sen_th = max_sen end
- local hp_percent = hp / hp_th
- local hp_max_percent = max_hp / hp_th
- local gin_percent = gin / gin_th
- local gin_max_percent = max_gin / gin_th
- local kee_percent = kee / kee_th
- local kee_max_percent = max_kee / kee_th
- local sen_percent = sen / sen_th
- local sen_max_percent = max_sen / sen_th
- local food_percent = food / max_food
- if max_food == 0 then food_percent = 1 end
- local water_percent = water / max_water
- local tire_percent = tire / 100
- -- fill entire box to clear it
- check (WindowRectOp (win, 2, 0, 0, 0, 0, BACKGROUND_COLOUR)) -- fill entire box
- -- Edge around box rectangle
- check (WindowCircleOp (win, 3, 0, 0, 0, 0, BORDER_COLOUR, 0, 2, 0, 1))
- vertical = 0 -- pixel to start at
- DoGauge (string.format("%s%12s",hpString .. ": " , "<" .. hp .. "/ " .. max_hp .. ">") , hp_percent, hp_max_percent, HP_COLOUR ,HP_COLOUR2)
- DoGauge (string.format("%s%12s",ginString.." : " , "<" .. gin .. "/ " .. max_gin.. ">") , gin_percent ,gin_max_percent, GIN_COLOUR , GIN_COLOUR2)
- DoGauge (string.format("%s%12s",keeString.." : " , "<" .. kee .. "/ " .. max_kee.. ">") , kee_percent ,kee_max_percent, KEE_COLOUR, KEE_COLOUR2)
- DoGauge (string.format("%s%12s",senString.." : " , "<" .. sen .. "/ " .. max_sen.. ">") , sen_percent ,sen_max_percent, SEN_COLOUR,SEN_COLOUR2)
- DoGauge (string.format("%s%12s",foodString..": " , "<" .. food .. "/ " .. max_food.. ">") , food_percent ,1, FOOD_COLOUR, FOOD_COLOUR2)
- DoGauge (string.format("%s%12s",waterString..": " , "<" .. water .. "/ " .. max_water.. ">") , water_percent ,1, WATER_COLOUR, WATER_COLOUR2)
- DoGauge (string.format("%s%12s",tireString..": " , "<" .. tire .. "/ 100>") , tire_percent ,1, TIRE_COLOUR , TIRE_COLOUR2)
- WindowShow (win, true)
- end -- draw_bar
复制代码 其實我不會用Lua. 這些全是改自Nick 在4.40 裏的.. 我連function 名字都沒改.
[ 本帖最后由 vase 于 2009-12-29 12:04 AM 编辑 ] |