PLEASE HELP!!!! Using Gyser to create a HP bar

Jor'Mox
Posts: 1101
Joined: Wed Apr 03, 2013 2:19 am

Re: PLEASE HELP!!!! Using Gyser to create a HP bar

Post by Jor'Mox »

Well, that is the problem. Your prompt looks like this: 100/500 > instead of 100 / 500 >
So you need to take out the spaces in the trigger pattern around the slash. So you should use this as the pattern: ^(\d+)/(\d+) >$

trentont101
Posts: 17
Joined: Fri Jan 17, 2014 12:07 am

Re: PLEASE HELP!!!! Using Gyser to create a HP bar

Post by trentont101 »

updated,
still not working :(
:(
could it be that the prompt is color coded, as in the color of the numbers changes if the health goes down or up???

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Re: PLEASE HELP!!!! Using Gyser to create a HP bar

Post by Akaya »

I see a grey box on your screen there... If its displaying a grey box instead of a gauge, you might need to apply a stylesheet...
Code: [show] | [select all] lua
hpbar = Geyser.Gauge:new({
  name = "hpbar",
  x = "60%", y = "20%",
  width = "45%", height = "5%",
})
hpbar.front:setStyleSheet([[
  background-color: grey;
]])
hpbar.back:setStyleSheet([[
  background-color: red;
]])
You should be able to see some changes with the color.

trentont101
Posts: 17
Joined: Fri Jan 17, 2014 12:07 am

Re: PLEASE HELP!!!! Using Gyser to create a HP bar

Post by trentont101 »

still not working, even when I removed the spaces to fit the prompt accordingly,
could the culprit be that the prompt is color coded and changes color when health goes up or down??
this shouldnt change the actual prompt search right?

trying the style sheet now

trentont101
Posts: 17
Joined: Fri Jan 17, 2014 12:07 am

Re: PLEASE HELP!!!! Using Gyser to create a HP bar

Post by trentont101 »

ok here is my script now

hpbar = Geyser.Gauge:new({
name = "hpbar",
x = "60%", y = "20%",
width = "45%", height = "5%",
})
hpbar.front:setStyleSheet([[
background-color: grey;
]])
hpbar.back:setStyleSheet([[
background-color: red;
]])

current_health = matches[2]
max_health = matches[3]
hpbar:setValue(current_health or 0,max_health or 1)

now i am getting the error
attempt to index global matches a nil value... did i install the script wrong?

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Re: PLEASE HELP!!!! Using Gyser to create a HP bar

Post by Akaya »

Delete the following from the script. You only need it in the trigger:

current_health = matches[2]
max_health = matches[3]
hpbar:setValue(current_health or 0,max_health or 1)

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Re: PLEASE HELP!!!! Using Gyser to create a HP bar

Post by Akaya »

And no. The color of the prompt shouldn't effect capturing it. You can add a confirmation echo to the end of your trigger to make sure its working...
Code: [show] | [select all] lua
echo("\nHooray! It worked!")

trentont101
Posts: 17
Joined: Fri Jan 17, 2014 12:07 am

Re: PLEASE HELP!!!! Using Gyser to create a HP bar

Post by trentont101 »

ok yes, i realized i doubled that up, i deleted it, it not will run without the error, changed background color to green (so i get more of an indicator) and now i have a green bar across my screen (prettier than the grey haha) still not reacting to my prompt though

ok, echo is NOT working, so something has to be up with the trigger.

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Re: PLEASE HELP!!!! Using Gyser to create a HP bar

Post by Akaya »

post another screenshot of your trigger?

trentont101
Posts: 17
Joined: Fri Jan 17, 2014 12:07 am

Re: PLEASE HELP!!!! Using Gyser to create a HP bar

Post by trentont101 »

http://postimg.org/image/uv3wsw23f/

http://postimg.org/image/dvuydmqvv/

for anyone with the same problem as me... i will write a detailed post at the VERY END when its working to help you all out I PROMISE!!

Post Reply