#define Move_Up 5 #define Move_Down 10
world maxx = 10 maxy=10 maxz=1
client/view = 7
atom/icon = 'Icons.dmi'
world/mob = /mob/player
mob/player/Login() Maximize() client.screen += cardobjects usr.contents += testOBJS
mob/player/Stat() statpanel("Iventory", usr.contents)
mob/player/var/tmp/never
mob/player/verb/True_False_Checker() set hidden = 1 if(never) never = null usr << "Never = False(null)" else if(!never) never = 1 usr << "Never =True(1)"
mob/proc/Maximize() winset(src,"window1", "is-maximized=true")
obj skillcards icon_state = "normal" layer = 6 MouseEntered() icon_state = "mouseover" MouseExited() sleep(1) icon_state = "normal" s_one screen_loc = "1,1" s_two screen_loc = "2,1" s_three screen_loc = "3,1" s_four screen_loc = "4,1" s_five screen_loc = "5,1" s_six screen_loc = "6,1" s_seven screen_loc = "7,1" s_eight screen_loc = "8,1" s_nine screen_loc = "9,1" s_zero screen_loc = "10,1"
obj buttons var/mob/player/P UP icon_state = "up" screen_loc = "5,6" Click() src.P = usr if(P.allowed) P << "[P.allowed] - P.allowed <b>if #1</b>" P.allowed = null P << "[P.allowed] - P.allowed <b>if #2</b>" P.direction = Move_Up P.list_iteration() P.set_macros() else P << "[P.allowed] - P.allowed" MouseEntered() icon_state = "flickup" MouseExited() sleep(1) icon_state = "up" DOWN icon_state = "down" screen_loc = "5,5" Click() src.P = usr if(P.allowed) P << "[P.allowed] - P.allowed <b>if #1</b>" P.allowed = null P << "[P.allowed] - P.allowed <b>if #2</b>" P.direction = Move_Down P.list_iteration() P.set_macros() else P << "[P.allowed] - P.allowed" MouseEntered() icon_state = "flickdown" MouseExited() sleep(1) icon_state = "down"
mob/player/var/tmp/allowed = 1
mob/player/var/tmp/direction
mob/player/var/tmp/neverclicked
obj test_objects var/mob/player/P DblClick() src.P = usr if(!P.neverclicked) P.neverclicked = 1 switch(alert("Would you like to macro this?",,"Yes","No")) if("Yes") var/number = round(input(P,"Which key would you like to macro this to? Enter a number between 1 and 10 (Decimals will be rounded down).","Input") as num) if(number < 1||number > 10) usr << "Value entered was too small/large. Please enter a value between 1 and 10." P.neverclicked = null return else var/obj/OO = P.grid_objoverlay[P.current_set_list][number] OO = null OO += src P << "<font color=blue>[OO] : OO</font> , <font color=purple>[src] : src</font> , [P.current_set_list] : P.current_set_list , <font color=red>[number]: number</font>" P.set_macros()
layer = 7 purple icon_state = "purple" blue icon_state = "blue" green icon_state = "green" red icon_state = "red" orange icon_state = "orange"
var/list/testOBJS = newlist(/obj/test_objects/purple,/obj/test_objects/blue,/obj/test_objects/green,/obj/test_objects/red,/obj/test_objects/orange)
mob/player/var/list/grid_objoverlay[6][10]
mob/player/var/list/grid_macrocommand[6][10]
var/list/cardobjects = newlist(/obj/skillcards/s_one,/obj/skillcards/s_two,/obj/skillcards/s_three,/obj/skillcards/s_four,/obj/skillcards/s_five,/obj/skillcards/s_six,/obj/skillcards/s_seven,/obj/skillcards/s_eight,/obj/skillcards/s_nine,/obj/skillcards/s_zero, /obj/buttons/UP, /obj/buttons/DOWN)
mob/player/var/tmp/current_set_list = 1
mob/player/var/tmp/keep_iterating = 1
mob/player/proc/set_macros() var/a = 0 var/b = 1 var/c = 1
var/obj/CO = cardobjects[b] var/obj/OO = grid_objoverlay[current_set_list][c]
keep_iterating = 1 if(keep_iterating) while(a<10) src << "[CO] : CO , [OO] : OO <b>Check 1</b>"
CO.overlays = null
src << "[CO] : CO , [OO] : OO <b>Check 2</b>"
CO.overlays += OO
src << "[CO] : CO , [OO] : OO <b>Check 3</b>" a++ b++ c++
src << "<hr></hr>[a] : a, [b] : b, [c] : c<br></br>"
while(a>=10) keep_iterating = null a = 0
mob/player/proc/list_iteration()
if(direction==Move_Up) current_set_list++ if(current_set_list>6) current_set_list = 1
else if(direction==Move_Down) current_set_list-- if(current_set_list<1) current_set_list = 6
|
var/obj/OO = P.grid_objoverlay[P.current_set_list][number]OO = null
OO += src
The first two lines, together, do nothing: you are storing something into a variable, then setting it to null. The third line then attempts to add an object to null, which really shouldn't be possible but because it is it just sets the value of OO to src.
You need to instead just change this to one line, setting grid_objoverlay[what][ever] to src.
You also have a lot of other stupid things, like:
keep_iterating = 1if(keep_iterating)
GEE I WONDER WHAT keep_iterating IS GOING TO BE!!!
And, I can't provide a snappy little snippet, but the way in which you are using mob variables to pass arguments in the wrong way to procedures which take no arguments is really, really poor design. For instance:
direction should not be a mob variable here. It should be a variable passed to this procedure. And it really should just be either +1 or -1, instead of using those if() statements.
Oh, and on another note: constants should be in ALL_CAPS.
Honestly, you are not the kind of person who should be making a demo.