ID:140532
 
Code:Macros
mob/verb/KeyD()
set hidden = 1
icon = "[usr].dmi"
icon_state = "Defend"
mob/var/setting=""
mob/Stat()
statpanel("Skills", contents)
mob/verb/Key1()
set hidden =1
var/obj/Macro/Macrobar1/M
for(M in usr.client.screen)
if(M:Action == "")
..()
else
call (/obj/Verbs/DblClick)()
mob/verb/Key2()
set hidden =1
var/obj/Macro/Macrobar2/M
for(M in usr.client.screen)
if(M:Action == "")
..()
else
call (/obj/Verbs/DblClick)()
mob/verb/Key3()
set hidden =1
var/obj/Macro/Macrobar3/M
for(M in usr.client.screen)
if(M:Action == "")
..()
else
call (/obj/Verbs/DblClick)()
mob/verb/Key4()
set hidden =1
var/obj/Macro/Macrobar4/M
for(M in usr.client.screen)
if(M:Action == "")
..()
else
call (/obj/Verbs/DblClick)()
mob/verb/Key5()
set hidden =1
var/obj/Macro/Macrobar5/M
for(M in usr.client.screen)
if(M:Action == "")
..()
else
call (/obj/Verbs/DblClick)()
mob/verb/Key6()
set hidden =1
var/obj/Macro/Macrobar6/M
for(M in usr.client.screen)
if(M:Action == "")
..()
else
call (/obj/Verbs/DblClick)()
mob/verb/Key7()
set hidden =1
var/obj/Macro/Macrobar7/M
for(M in usr.client.screen)
if(M:Action == "")
..()
else
call (/obj/Verbs/DblClick)()
mob/verb/Key8()
set hidden =1
var/obj/Macro/Macrobar8/M
for(M in usr.client.screen)
if(M:Action == "")
..()
else
call (/obj/Verbs/DblClick)()
mob/verb/Key9()
set hidden =1
var/obj/Macro/Macrobar9/M
for(M in usr.client.screen)
if(M:Action == "")
..()
else
call (/obj/Verbs/DblClick)()
mob/verb/Key0()
set hidden =1
var/obj/Macro/Macrobar10/M
for(M in usr.client.screen)
if(M:Action == "")
..()
else
call (/obj/Verbs/DblClick)()
obj/Macro/var/Action = ""
obj/Macro/Click()
if(usr.setting !="")
Action = usr.setting
icon = usr.setting:icon
icon_state = usr.setting:icon_state
usr.setting = ""
usr.client.mouse_pointer_icon = "mouse.dmi"
obj/Verbs
Click()
usr.setting = src
usr.client.mouse_pointer_icon = src.icon
icon = 'Macrobar.dmi'
DblClick()

//TEST
// icon = 'Macrobar_Fireball.dmi'
// usr<<output("<font color=white><B>FireBALL!.")
/*obj/Verbs/Fireball
Click()
usr.setting = src
usr.client.mouse_pointer_icon = src.icon
icon = 'Macrobar_Fireball.dmi'
DblClick()
usr<<output("<font color=white><B>Fireball.")
*/


obj/Macro/Macrobar1
icon = 'Macrobar.dmi'
icon_state = "1"
layer=OBJ_LAYER+99
New()
screen_loc = "1,10"
/* var/obj/Attack/Sword/S
var/obj/Macro/Macrobar1/M
M:Action = new S ()*/

obj/Macro/Macrobar2
icon = 'Macrobar.dmi'
icon_state = "2"
layer=OBJ_LAYER+99
New()
screen_loc = "1,9"
obj/Macro/Macrobar3
icon = 'Macrobar.dmi'
icon_state = "3"
layer=OBJ_LAYER+99
New()
screen_loc = "1,8"
obj/Macro/Macrobar4
icon = 'Macrobar.dmi'
icon_state = "4"
layer=OBJ_LAYER+99
New()
screen_loc = "1,7"
obj/Macro/Macrobar5
icon = 'Macrobar.dmi'
icon_state = "5"
layer=OBJ_LAYER+99
New()
screen_loc = "1,6"
obj/Macro/Macrobar6
icon = 'Macrobar.dmi'
icon_state = "6"
layer=OBJ_LAYER+99
New()
screen_loc = "1,5"
obj/Macro/Macrobar7
icon = 'Macrobar.dmi'
icon_state = "7"
layer=OBJ_LAYER+99
New()
screen_loc = "1,4"
obj/Macro/Macrobar8
icon = 'Macrobar.dmi'
icon_state = "8"
layer=OBJ_LAYER+99
New()
screen_loc = "1,3"
obj/Macro/Macrobar9
icon = 'Macrobar.dmi'
icon_state = "9"
layer=OBJ_LAYER+99
New()
screen_loc = "1,2"
obj/Macro/Macrobar10
icon = 'Macrobar.dmi'
icon_state = "0"
layer=OBJ_LAYER+99
New()
screen_loc = "1,1"


Problem description:
The problem is that I can only use the Verb called verbs. I can get the picture to change if i double click on it. But what i want is to have a listing of different skills in a command bar and when you click on one and click on the macro box it sets it.

Thank you Byond community!

1: Don't use :
2: That format makes my eyes bleed
mob
verb
verb1()
verb2()
verb3()
//and so on

Looks much better, huh?
Similar option can be used for your obj's.
3: http://www.byond.com/developer/articles/start