Programming practice

OP
Merlijn

Merlijn

Shadow Master
Mar 11, 2009
2,284
Croga said:
I have a tiny very simple request.....

When I'm herbing I'd like to get a message on screen and maybe a sound played whenever I get a Frost Lotus. Makes it all that tiny bit more exciting :)

Think I managed to write this today. Gonna test it tonight (without sound yet but the code already written for it, just lacking a soundfile)

/pray :unsure:

P.S. If it works I'll see if I can write something for Crono's request.. do you also want it to set the loot to Rare btw? ;)
 

Croga

Says funny things =)
Sep 9, 2008
892
The Hellmouth
Merlijn said:
Think I managed to write this today. Gonna test it tonight (without sound yet but the code already written for it, just lacking a soundfile)
If you need help testing then let me know.
If you need someone to do a code review let me know as well; I'm pretty interested in the code anyway and I do have a couple of years of experience in the field :)
 

Cronocious

Well-Known Member
Mar 24, 2007
831
ooo, yes please merl :D looked around so much for an addon that does that but the only one i found is broken and forces group loot instead of ML which is dumb lol
 
OP
Merlijn

Merlijn

Shadow Master
Mar 11, 2009
2,284
Croga said:
Merlijn said:
Think I managed to write this today. Gonna test it tonight (without sound yet but the code already written for it, just lacking a soundfile)
If you need help testing then let me know.
If you need someone to do a code review let me know as well; I'm pretty interested in the code anyway and I do have a couple of years of experience in the field :)

Tested and fine-tuned it tonight. It's "working" yet it seems that the holdtime for the message to be on the screen can't be adjusted atm. Tried multiple numbers yet it remains stubborn to be on your screen for 10 seconds which is imo way to long. Temporarily using the levelup sound btw but can change this to any in-game sound of wrap it up with some fancy wav file :)
 
OP
Merlijn

Merlijn

Shadow Master
Mar 11, 2009
2,284
Cronocious said:
ooo, yes please merl :D looked around so much for an addon that does that but the only one i found is broken and forces group loot instead of ML which is dumb lol

Talked this over with a friend of mine tonight and seems really easy to make. Will see what I can do tomorrow.
 
OP
Merlijn

Merlijn

Shadow Master
Mar 11, 2009
2,284
Joyma said:
Improving the auctioning addon would be nice btw, but can imagine a fresh project is more interesting.

What's the name of the addon you're using for this Joy? And what would you like to see changed?

Can look into this when I'm done testing Crono's addon. Still waiting for a reply on my post I made on the blizz forums for the HoldTime on Croga's addon. If I'm not getting any then learn to live with it :p
 
OP
Merlijn

Merlijn

Shadow Master
Mar 11, 2009
2,284
Exactly. I assume Joy is referring to the one Arly is talking about but I don't know what it's called.
 
OP
Merlijn

Merlijn

Shadow Master
Mar 11, 2009
2,284
Merlijn said:
Think it's done Crono. Needs testing tho to see if it works :)

The addon "works" but the only problem atm is because the changing to ML and changing of quality to rare are called instantly after eachother the game forces it back to group loot causing the script to run again resulting in massive spam trying to change it.. Need to figure out how to make a delay in between these for a second or so and it'll work

If anyone has Lua experience and knows how to make this delay easily feel free to give a shout.
 

Arly

Non-Shouter
Oct 3, 2007
1,733
Merlijn said:
Merlijn said:
Think it's done Crono. Needs testing tho to see if it works :)

The addon "works" but the only problem atm is because the changing to ML and changing of quality to rare are called instantly after eachother the game forces it back to group loot causing the script to run again resulting in massive spam trying to change it.. Need to figure out how to make a delay in between these for a second or so and it'll work

If anyone has Lua experience and knows how to make this delay easily feel free to give a shout.

Sleep ? (Might have found an answer for some other game, looking into it now)

Here is a thread about Sleep in lua scripts. (Not sure if there is any difference on lua scripting or if it is a standard)

http://stackoverflow.com/questions/1034 .... ew-seconds
 
OP
Merlijn

Merlijn

Shadow Master
Mar 11, 2009
2,284
A regular "Sleep" as in C does not seem to exist in LUA unfortunately. Need to learn to understand this code a bit better before I want to simply copy/paste it hoping it'll work.
 

Arly

Non-Shouter
Oct 3, 2007
1,733
If you check the link i posted it seems you can do win.Sleep(1000) (for 1 sec), or os.Sleep(millisec) did you test it?
 
OP
Merlijn

Merlijn

Shadow Master
Mar 11, 2009
2,284
Arly said:
If you check the link i posted it seems you can do win.Sleep(1000) (for 1 sec), or os.Sleep(millisec) did you test it?

Haven't tested them yet, will do that later tonight when I get back home but I'm guessing there won't work in the game since they're called win & os.. then again.. assumptions is.... you know :p
 
OP
Merlijn

Merlijn

Shadow Master
Mar 11, 2009
2,284
tried it and unfortunately doesn't work....

separated the setting to ML and setting threshold now so that ML is set when you form the raid or become the RL and firing the threshold setting event to when the loot method is changed but will have to see if that works good enough and doesn't cause the same problem as before.