so how do i format this in Lua? the code is a little different...
seccond.... well..... if i had a lua example of this code i could figure out what is next, i would assume sharing the queue on the addon channel to process information...
i believe that would be in the deQueue or isEmpty function...
Basically this is supposed to tell me when a user is online, and if they are in the queue... if they are not in the queue AddQueue() then loop the normal function of scanning for users online with the addon running... if the user goes offline, remove them from the queue...
most of the time is gonna be spent with the addon offline if the Guildmaster isnt there, its just a precaution to have this so when the gm is busy or offline officers can still make this availible to their users... the next think would be to make sure the GM's Database is allways up to date and the others just gather data from it... so updating is for the most part of this code also...
but like i said this is java, i have made 3 attempts to build this in lua, and failed the first time, the seccond time was 30% working but had a few minor errors... mostly script wise....
BUT the main importance is that this queue needs to be in constant communications with other users using this addon, so its not a local script... its shared between users... and thus, it cannot read local variables must read shared variables... (where i got lost on the 2nd attempt..) it worked, but was random choosing who it picked to turn off the addon...
thus comes the part where the active queue user ... say for example:
Client1 = 0
Client3 = 1
Client2 = 2
Client4 = 3
Client 0 send the kill command addon_name:UnregisterEvent("THISEVENT") to client 3,2,4 - but! Client 3,2,4 continue to check the queue if client1 is online like this:
if UnitIsConnected(Client1) == 1 then
--do nothing - continue waiting for offline
elseif UnitIsConnected(Client1) == 0 then
addon_name:RegisterEvent("THISEVENT")
but it has to be brodcast on the addon channel so we use this:
of coarse the event has to be properly registered, and it is said specifically that the "SENDER" can be omited and is only used when communicating on the WHISPER channel, but i found that it can be helpful in identifying other users who send data on a larger number basis on the guild channel... (re-inventing the wheel?!)
ive tested this and if its a non-standard way of collecting data, then what approch should i use? im all for using it way to collect data.. even thou it wasnt meant to be used this way... (more than one way to skin a cat...)
IVE WRITTEN THIS CODE 3 TIMES, i need some help please.. i fail'd... i wasted 3 days... and countless hours yelling at my laptop... and it kept yelling back...
This should work, everything is here.... Just not sure how to write it...
you havent downloaded my addon have you? its almost 2000 lines
i can program lua, i know how to, this is technical, like i said, ive done it three times..
i even done it on papper, what is trying to be accomplished here is a multiuser function and i need another user to collaborate with... yawn...
the whole code is sitting right there... i just need someone to help me put it together...
ive tried, and failed like i said... btw, that is thirty chapters..... id give it a week... but id rather not confuse myself reading cpu lingo... its like learning Japanese... you know there are 4 dialects... and 4 different ways to write Japanese? also did you know there is more than two hundred characters in their alphabet...
seems, like im being flamed as a noob, maybe ill just stay off the forums... (not to be mean or upset) i completely understand people like to help.... sirow was most helpful yet... i dunno...
ok, i slapped this together from that damn java translation.... still doesnt work, but its a little cleaner...
guildbot2 = CreateFrame("frame")
local queue = 0
guildbot2:RegisterEvent("CHAT_MSG_GUILD");
guildbot2:SetScript("OnEvent", function(_, event, ...) guildbot2[event](...) end);
local databaseupdate = CreateFrame("Frame", "ViewAddonMessageFrame")
local function printMsg(_, _, prefix, msg2, type, sender)
ChatFrame3:AddMessage("["..prefix.."]["..msg2.."]["..type.."]["..sender.."]")
function QueueAdd( queue, qnewname, qnewvalue ) -- adds or creates a new value
if queue == nil then -- if the queue is empty create a new one
queue = { qname = qnewname, qvalue = qnewvalue } -- add this as root
return queue -- return the new queue
else
if qnewvalue < 1 then -- if less, recursively add
return QueueAdd( queue, qnewname, qnewvalue )
else -- otherwise, add same
return QueueAdd( queue, qname, qvalue )
end
end
end
function QueueMin( queue, qname) -- returns with the smallest value
if queue == nil then -- if the queue is empty, return nil
return nil
else if queue ~= 0 then -- recursively
return QueuePeek( queue, qname )
else -- if no name is found, it will be the smallest value
return queue
end
end
function QueuePeek( queue, qname ) -- returns the next value without removing it
local min = QueueMin ( queue, qname )
return min.qvalue
end
function QueueNext( queue, name )-- returns the next value after removing it from the queue
local min = QueueMin ( queue, name )
local minValue = min.qvalue
if min.qvalue == nil then-- check to see if the minimum has children
min = nil -- if so, remove it
else -- otherwise, replace the minimum with the other value
min = min.qvalue
end
return minValue -- return the minimum value
end
end
SendAddonMessage("GBOT!Q", "QUEUE DATA:", "GUILD", "SENDER")
end
databaseupdate:SetScript("OnEvent", printMsg)
databaseupdate:RegisterEvent("CHAT_MSG_ADDON")
function guildbot2.CHAT_MSG_GUILD(msg, sender, ...)
-- if strfind(msg, string.upper("$TEST")) then
queue = queue + 1
SendAddonMessage("GBOT!Q", queue, "GUILD", "SENDER")
--print("test?channel") --debugging
-- end;
end
its even more of a fail then my last one, but its cleaner like i said... im getting closer, but still not there yet... didnt have time to debug and go over it line by line, im tired of staring at it by this point.. going cross eyed.... ready to start over and try attempt #5...
can someone else flame me now?
do you see the length of that code and why im asking for help? thats one function and %10 of my current update, if i could get it to work.... the next part is gonna be hella hard too... but if this worked, the foundation would be set and it would make the rest that much easier...
i know i screwed up somewhere in that code, i just am tired of it...
just cant see it after saying "im trying to build a queue and it sounds like q, but it has a u-e , u-e at then end and its spelled q-u-e-u-e...." ten times fast...
lost 4 days on this... think im just gonna hang the hat on this one... i have a whole list of stuff to do, this one is challenging, thats why i picked it... and like i said, its the foundation for this update.. thats one "10%" of the code i need to finish this update....
i could be making progress... this is just slowing me down... maybe i can find another way to do this w/o building a queue... just thought it would be nice to put stuff in a line... orderly fashion..
1)...(we) are also not going to download your addon for the sake of helping you.
2)And nobody likes hand-feeding.
1) (joking...) whats this WE stuff? u got a mouse in your pocket?
2) its why i have been asking for help for 3 days... but like i said... ill just stay off the forums and figure it out... didnt get an ounce of help(maybe a tiny bit, but mostly minor), just heart ache, and almost got banned once... think it was easier flying solo...
Perhaps if you didn't ask for hand-outs and used proper grammar, then maybe people would be more receptive. Also, by "we," I mean the people on this forum.
Perhaps if you didn't ask for hand-outs and used proper grammar, then maybe people would be more receptive. Also, by "we," I mean the people on this forum.
wasnt asking for a hand out, you can see, i wrote over 100 lines in this one post alone... asking for help... asking for a hand out would be me telling you to write something for me, im asking for help to make what i have work...
and, i guess i will just leave the forums alone...
you can consider my posts abandon'd cause im not gonna reply...
judging people by their grammar or they way they speak is discriminating and racist... i dont judge people... i treat everyone as an equal... and if they were offended by my grammar why cant they say it? your appointed to speak for everyone?
im tired of being flamed, and i have enough self respect to not fire off a retort... laterz...
Grammatical comprehension is not a race, and nobody here gives a rat's ass about your race, or about how you talk in real life. If you can't be bothered to put in any effort to proofread your posts and make them as easy to read as possible, why should other people, who don't know you, and who post here in their spare time for free as a hobby, put in any effort trying to help you? Finally, I haven't seen any flaming in this thread, just complaints from people who would be happy to help you if reading your posts wasn't an exercise in masochism. If you'd rather leave than spend a few extra seconds to proofread your posts so they actually make sense to people who aren't inside your head, good riddance.
Locking these threads. If you want to post a new thread that doesn't involve whining about how you think other people should slog through your lazily-written rambling and magically figure out what you're trying to do and what you've already tried, feel free.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
so how do i format this in Lua? the code is a little different...
seccond.... well..... if i had a lua example of this code i could figure out what is next, i would assume sharing the queue on the addon channel to process information...
i believe that would be in the deQueue or isEmpty function...
Basically this is supposed to tell me when a user is online, and if they are in the queue... if they are not in the queue AddQueue() then loop the normal function of scanning for users online with the addon running... if the user goes offline, remove them from the queue...
most of the time is gonna be spent with the addon offline if the Guildmaster isnt there, its just a precaution to have this so when the gm is busy or offline officers can still make this availible to their users... the next think would be to make sure the GM's Database is allways up to date and the others just gather data from it... so updating is for the most part of this code also...
but like i said this is java, i have made 3 attempts to build this in lua, and failed the first time, the seccond time was 30% working but had a few minor errors... mostly script wise....
BUT the main importance is that this queue needs to be in constant communications with other users using this addon, so its not a local script... its shared between users... and thus, it cannot read local variables must read shared variables... (where i got lost on the 2nd attempt..) it worked, but was random choosing who it picked to turn off the addon...
thus comes the part where the active queue user ... say for example:
Client1 = 0
Client3 = 1
Client2 = 2
Client4 = 3
Client 0 send the kill command addon_name:UnregisterEvent("THISEVENT") to client 3,2,4 - but! Client 3,2,4 continue to check the queue if client1 is online like this:
but it has to be brodcast on the addon channel so we use this:
of coarse the event has to be properly registered, and it is said specifically that the "SENDER" can be omited and is only used when communicating on the WHISPER channel, but i found that it can be helpful in identifying other users who send data on a larger number basis on the guild channel... (re-inventing the wheel?!)
ive tested this and if its a non-standard way of collecting data, then what approch should i use? im all for using it way to collect data.. even thou it wasnt meant to be used this way... (more than one way to skin a cat...)
IVE WRITTEN THIS CODE 3 TIMES, i need some help please.. i fail'd... i wasted 3 days... and countless hours yelling at my laptop... and it kept yelling back...
This should work, everything is here.... Just not sure how to write it...
I highly suggest reading Programming in Lua.
People around here generally don't mind helping, when the person in need of help is at least familiar with the basics of the language.
you havent downloaded my addon have you? its almost 2000 lines
i can program lua, i know how to, this is technical, like i said, ive done it three times..
i even done it on papper, what is trying to be accomplished here is a multiuser function and i need another user to collaborate with... yawn...
the whole code is sitting right there... i just need someone to help me put it together...
ive tried, and failed like i said... btw, that is thirty chapters..... id give it a week... but id rather not confuse myself reading cpu lingo... its like learning Japanese... you know there are 4 dialects... and 4 different ways to write Japanese? also did you know there is more than two hundred characters in their alphabet...
seems, like im being flamed as a noob, maybe ill just stay off the forums... (not to be mean or upset) i completely understand people like to help.... sirow was most helpful yet... i dunno...
done that b4.... dual logging, learned that bout 5 years ago... next...
its even more of a fail then my last one, but its cleaner like i said... im getting closer, but still not there yet... didnt have time to debug and go over it line by line, im tired of staring at it by this point.. going cross eyed.... ready to start over and try attempt #5...
can someone else flame me now?
do you see the length of that code and why im asking for help? thats one function and %10 of my current update, if i could get it to work.... the next part is gonna be hella hard too... but if this worked, the foundation would be set and it would make the rest that much easier...
just cant see it after saying "im trying to build a queue and it sounds like q, but it has a u-e , u-e at then end and its spelled q-u-e-u-e...." ten times fast...
lost 4 days on this... think im just gonna hang the hat on this one... i have a whole list of stuff to do, this one is challenging, thats why i picked it... and like i said, its the foundation for this update.. thats one "10%" of the code i need to finish this update....
i could be making progress... this is just slowing me down... maybe i can find another way to do this w/o building a queue... just thought it would be nice to put stuff in a line... orderly fashion..
any suggestions before i go back to flying solo?
One last word of advice: people aren't psychic and they don't know what you've tried so far. ;)
1) (joking...) whats this WE stuff? u got a mouse in your pocket?
2) its why i have been asking for help for 3 days... but like i said... ill just stay off the forums and figure it out... didnt get an ounce of help(maybe a tiny bit, but mostly minor), just heart ache, and almost got banned once... think it was easier flying solo...
wasnt asking for a hand out, you can see, i wrote over 100 lines in this one post alone... asking for help... asking for a hand out would be me telling you to write something for me, im asking for help to make what i have work...
and, i guess i will just leave the forums alone...
you can consider my posts abandon'd cause im not gonna reply...
judging people by their grammar or they way they speak is discriminating and racist... i dont judge people... i treat everyone as an equal... and if they were offended by my grammar why cant they say it? your appointed to speak for everyone?
im tired of being flamed, and i have enough self respect to not fire off a retort... laterz...