ID:1124789
 
Keywords: forum_account, macro
(See the best response by Jemai1.)
Code:
mob
key_down(k)
if (k == "east")
quickturneast()
else if (k == "west")
quickturnwest()
else if (k == "south")
crouch()
else if (k == "a")
actiona()
else if (k == "/")
battle()

key_up(k)
if (k == "south")
stand()

key_repeat(k)
if (k == "east")
client.East()
else if (k == "west")
client.West()


Problem description:
(This is used with Forum_Accounts Keyboard Library.)
So I read the library and it said if I set a block of code as such then it would read the keys for me. However it doesnt seem to do anything. I have added macros and tried it without any macros. I have checked the "focus" var to make sure the client's mob is the target. Any idea as to what I am missing or did wrong? Am I defining the macros wrong?

Make sure you don't have other key_down/up/repeat procs that are interfering. You might have included the demo files. Uncheck those.
The Demo's are not included and I haven't involved the code anywhere else yet.
Are you getting any errors? How did you include the library?
I just checked the box in libraries. I believe that is how its intended to be used.
oh also I have made sure Forum_Account's Text is included.
Yes, you did that right. How are you setting the focus variable of the client? It should be somehow like this
mob
Login()
client.focus = src
..()
I double checked the client.focus and its set properly.
Well, that's weird. Are you overriding any proc that is used by the library? For example, the client's New proc.
None of my code overwrites the client's New proc.
Mind showing your Login proc and anything relevant?
world
fps = 10
icon_size = 64
map_format = SIDE_MAP
loop_checks = 0

view = 6

mob/creating_character
Login()
spawn()
src.char_form.DisplayForm()
RemoveVerbs()
return
mob
Login()
client.focus = src
..()
sample_report()
dir = EAST
icon_state = "MAIN"
bound_x = 37
bound_y = 0
bound_height = 104
bound_width = 48

mob
key_down(k)
if (k == "east")
quickturneast()
else if (k == "west")
quickturnwest()
else if (k == "south")
crouch()
else if (k == "a")
actiona()
else if (k == "/")
battle()

key_up(k)
if (k == "south")
stand()

key_repeat(k)
if (k == "east")
client.East()
else if (k == "west")
client.West()

Which mob are you using?

Are you using other libraries?
I am using Deadron's CharacterHandling and Dantom's htmllib.
So if I understand this right Deadron's ChracterHandling is overwriting my client New()?
Yes, it does.
In response to Sleinth
Sleinth wrote:
So if I understand this right Deadron's ChracterHandling is overwriting my client New()?

After closer examination of the CharacterHandling Im pretty sure its not responsible. it looks like its looped so after character creation the client proceeds with any normal processes for New().
FA's library is giving macros in client/New(). If you overwrite that, the library won't work. Though inclusion of libraries work alphabetically so Deadron's lib will be included before FA's. That means FA's lib is supposed to be the one overwriting Deadron's client/New.

You still did not answer my question though. Which mob are you using? You have not set focus on /mob/creating_character so the key_ procs won't work on that.
mob/creating_character is only listed because it uses another login proc.
When you reach the map you are no longer using mob/creating_character. you create a new mob and are sent back through the login proc, which is where the other login code sets the focus since it hasnt been used yet.
Would you mind running the following code?
mob/verb/debug_test()
src << "type: [type]"
if(istype(client.keys))
src << "client.keys: [client.keys.len]"
else
src << "client.keys = \"[client.keys]\""
Page: 1 2