ID:141065
 
I have made a grid on the interface
I have two grids, TestA and TestB.

If I click the object in TestA it will create the same object in TestB, so now there are two of the objects. Now if you click the object in TestB it will tell you its name:

Click()
usr << src.name


I know the above isnt correct but it is just a test.

Although If you press the object in TestA it still creates the same object in TestB so now there are two objects in TestB and on in TestA, and when we click the object in TestB it will say its name..

Anyone know how to help me please?

Use the Click() proc's control parameter: http://www.byond.com/docs/ref/info.html#/atom/proc/Click
In response to Nickr5
I looked in the example but it doesnt show how to do it..

obj
Stuff
Click(TestA)
var/items = 0
winset(usr, "TestA", "cells=[++items]")
usr << output(src, "TestA")
Click(TestB)
usr << src.name


this doesnt work, I know I am doing something wrong when trying to check if it is in the control TestA or TestB, please help...

In response to Zalenthio
You should probably read the link he gave, you know. And if you can't figure it out, then the DM Guide, since using if() statements and arguments of procs are fundamental things that you should learn about.
In response to Kaioken
I have read it, over and over and over again, all I ask is if you can show me an example of how it works.

my final result is this:

obj
Stuff
Click(mainwindow.TestA)
var/items = 0
winset(usr, "TestA", "cells=[++items]")
usr << output(src, "TestA")
Click(mainwindow.TestB)
usr << src.name

In response to Zalenthio
sorry to bump this but I really need help, I don't understand the functions, please help..
In response to Zalenthio
You'll have to reference the object somewhere else. As far as I know there's no way to pull data about whats in a grid.
In response to Falacy
mob/var/list/Pack = list()
mob/var/list/Equipment = list()

obj
verb/Get()
set src in oview(1)
src.loc = usr
usr.AddToPack(src)
verb/Equip()
src.loc = usr
usr.AddToEquipment()
Sword
icon = 'Objects.dmi'
icon_state = "Sword"
Potion
icon = 'Objects.dmi'
icon_state = "Potion"

mob
proc
AddToPack(var/obj/A)
for(A in usr.Equipment)
usr.Equipment -= A
usr.Pack += A
usr << output(A, "Pack")
winset(usr, "Pack", "cells=[usr.Pack]")
AddToEquipment(var/obj/A)
usr.Pack -= A
usr.Equipment += A
usr << output(A, "Equipment")
winset(usr, "Equipment", "cells=[usr.Equipment]")


That is my code for the game...

I hope it can help people help me lol.

Anyway doing this it works, and adds to the pack when I do Get. But how can I make it go away from the pack and into the Equipment. It goes into the equipment but doesnt go out of the pack :S, if anyone can help, please do :D
In response to Zalenthio
Zalenthio wrote:
I have read it, over and over and over again, all I ask is if you can show me an example of how it works.

Ugh. This is really basic stuff, and as I said if you don't know how to work with it, you should read some beginner tutorials and the DM Guide. This topic shows you don't know how to use DM well enough yet to be diving into interface controls.
Your example:
obj/something/Click(c_loc,c_control)
usr << "You clicked [src] at the '[c_control]' control!"

This outputs to the player the ID of the control where he clicked the obj.
In response to Kaioken
In response to U_CANT_C_ME1
WTH? I didnt post that message >> am I being hacked!

I know all of this stuff >< wtf is going on!

I also cant remove it >>

Should I report it?
In response to U_CANT_C_ME1
U_CANT_C_ME1 wrote:
WTH? I didnt post that message

Wasn't that a thanks message, probably by Zalenthio? Apparently, he got accidentally logged into your key. I hear this happens; wouldn't be the first time I read something like that.
In response to Kaioken
Oh okay, then it is alright.. :D

You deserve that thanks, it looks like you gave him what he wanted =D.