Arduino Project - Threat Level Lamp
Hi guys,
First timer here, but ill get to the point. I'm working on an university assignment, that requires the use of an Arduino electronic board, the assignment basically had to be awesome so i proposed to make a threat level lamp. Basically what happens is: No Threat - Lamp is White Threat Level Low - Lamp turns Green Threat Level Medium - Lamp turns Yellow Threat Level High - Lamp turns Red Of course this is a really simple yet fun idea. I'm suppose to expand on that proposal idea to my lecturer. I have extremely limited programming knowledge but can learn pretty well. But if you guys can point me out in the right directions, on how newbies can start learning the scripting of WoW addons and etc. It would be greatly appreciated. If you like I can even credit you on help by the end of the assignment. You could even throw in suggestions and all, would love to hear what you think of it! Hope to have a lot of talk with you all =) |
You have a big problem ... WoW-AddOns are not allowed to communicate with the system. So you have no way to pass the info from the game to your board.
|
thanks for the fast reply, but doesn't the G15 have something similar to it?
sorry, may be completely missing the mark as im as newbie as it gets. |
I believe the G15 LCD stuff is built into WoW, and not something addons can directly access. When you extract UI data there are XML files related to this, but as far as I'm aware this isn't something that addons can override or interact with.
Even if you were to somehow write or acquire an emulator for the LCD (I have no idea if such a thing exists but I would guess not), I don't think threat is even something that WoW sends to be displayed on the LCD (at least according to the layout XML, it is not), so you still wouldn't end up with the data you need. The only ways I can think of achieving what you want would be to either, 1) peek into WoW's memory directly, or 2) have an addon display threat on the screen in an easily-parsable way, and then write a program to read the screen. From there your program would send its data to the LED. The first option is probably way too advanced, and uses mechanisms similar to what cheat programs would use, so you'll probably face very significant obstacles designed specifically to prevent what you want to do. This may also violate the ToS or EULA in some way (research this yourself). I wouldn't recommend this to someone new to programming in a million years. The second is less difficult and probably less risky in terms of any violations (but I still wouldn't necessarily count on that, as they tend to be drawn very widely). But it is still comparatively difficult--you'll have to research yourself how to constantly grab screen data on whatever OS you're using and extract the data you need from those images. If you can do that, the addon part wouldn't be particularly difficult, but if you've never looked at Lua before obviously you will have to learn a little about that along with WoW's widget API so you can make a small coloured texture on-screen somewhere that changes with your threat level, which your program would have to capture and read from. Honestly, I think both methods are probably way too ambitious for a student without significant programming experience to do as a simple (I assume undergrad) project. In my opinion, it's best to take the restrictions imposed on addons at face value--addons cannot communicate with the outside world while WoW is running. So if I were you I'd either look at things that can be done by parsing SavedVariables (which isn't very exciting since you have to close WoW before you could run your program), or come up with a different idea. Trying to bypass the restrictions imposed on addons is a pretty advanced task and probably not worth the trouble. |
thanks very much for the reply, ill look into it and maybe change my way on working on it/ work on something else =)
|
Reading memory is always safer than giving your program read AND write privileges. On other hand, it's a bit risky and would require too much work outside your field to accomplish.
You COULD make a emulator, that emulates threat levels and gives signals to your dongle thing? I guess you just need some numbers going up and down at certain pace. :) |
hm that's also a good idea, thanks. ill ask the professor
|
I remember seeing a similar project once. Somebody used a light sensor of some sort, with a small frame in the bottom corner of the screen, and monitored it with the Arduino. It lit a series of lights based on their combo points. Your idea is definitely doable this way.
|
First thing that comes to mind is a mod that reports your threat level to a certain chat channel, you could have a visual basic app to monitor that particular chat log for those lines, then sends it to your Arduino board and then to the lamp of course =)
|
@TMcMahon51
would u happen to know where to find more information on that project sounds, might give me more clues on what i want/can do. @Clyde_Mobster oh sounds great! could you elaborate into finer details on how i can get that to work, judging by the posts earlier it sounds like it wouldn't be possible, but if it works then i can continue with my idea concept! |
Quote:
|
As for the wow mod, i've seen tons of 'chat announced' things in game from other player's mods, so I'm sure one could be written to announce/send your threat level to a particular chat channel. Chat logging should be turned on so it's sent to a .txt file within the WoW directory.
Then you'd have to have some sort of app that reads this txt file, based on what ever percentage range you want your lamp colors to be, it would send the signal to the Arduino board to activate that color. My knowledge of Arduino is almost non existent... so I'm just assuming that there is a driver that allows you to hook up the board to the PC using an available port of some type. Making an app/script to read a txt file for a particular string is one of the easiest things to do. However i'm not sure about sending the signal to the board, this is something you'll need to research. My initial suggestion was creating an app with visual basic, it's easy and there's tons of sources out there. Thats about all I can offer to ya, I'll keep checkin up on your status though, can't wait to see some pic's and your code on it =) |
ah wouldve been really interesting learning about how he did it
|
Quote:
|
@Phanx
ah bummer, so it wont work as live time =\ @Clyde_Mobster regardless of it not working as thought, thanks a lot of the information. seems useful for me to find out how it will work regardless. |
You could do what I did that worked, though you will need knowledge of another language as well.
I created an addon on WoW that was a 1 pixel by 1 pixel frame that changed colors, then had an outside program (coded in Delphi 7) color-pick the pixel location and read out commands from it. ;) |
Quote:
also would like to know if other people, have any good ideas that might be simple but creative enough =D |
If you make an addon in-game that creates a 1x1 pixel (or larger if it fancies you) then make that addon change the color of the texture you are showing to white, red, green, yellow or what ever you wish it to; then you can can read the color from the pixel at position x,y on screen with a program -for example AutoIT3 has simple to use API for pixel color reading.
Then it is a mater of making the script running on the machine send those signals to your hardware, dunno what interface you use. ;) The lua code I wrote explained: Code:
-- I just use the UIParent frame since I then have to write less code :P Code:
; pattern to match the game window |
omg great thanks a lot!
i'll have a closer look once i get the chance, also wanna test it out but since my comp recently wiped i gotta reinstall WoW :mad: |
All times are GMT -6. The time now is 08:01 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI