I'm better than @StormyFF and I want to share this beatiful feature!
uirefine.py
Add at top of file:
import chr
import chr
In class RefineDialogNew(ui.ScriptWindow):
add:
self.materials = []
Place it under:
self.type = 0
In function AppendMaterial(self, vnum, count), after creating thinBoard:
thinBoard = self.__MakeThinBoard()
thinBoard.SetPosition(50, self.dialogHeight)
thinBoard.SetSize(191, 20)
Add:
materialIndex = len(self.materials)
self.materials.append((vnum, count))
thinBoard.SetEvent(lambda: self.OnClickMaterial(materialIndex))
At the end of file add:
def OnClickMaterial(self, materialIndex):
if materialIndex >= len(self.materials):
return
if chr.IsGameMaster(0):
vnum, count = self.materials[materialIndex]
net.SendChatPacket("/item %d %d" % (vnum, count))