[Plugin] xControl

Addind a little tool to know the exact name from NPC’s when using TELEPORT command

from phBot import *
import QtBind

pVersion = 'v0.0.2'
pName = 'xNPC'

# Needed for phbot GUI
gui = QtBind.init(__name__,pName)
lblNpcs = QtBind.createLabel(gui,"List of NPC's near to you..",21,11)
btnNpcs = QtBind.createButton(gui,'btnNpcs_clicked',"  Refresh list  ",645,8)
lstNpcs = QtBind.createList(gui,21,30,700,200)

# Clear and load the list of NPCs		
def btnNpcs_clicked():
	# Get all NPCs and teleporters
	npcs = get_npcs()
	# Clear the list of npcs
	QtBind.clear(gui,lstNpcs)
	if npcs:
		for key in npcs:
			# Append every NPC description to the list
			QtBind.append(gui,lstNpcs," Name ["+npcs[key]['name']+"] - Model ["+str(npcs[key]['model'])+"] - ServerName ["+npcs[key]['servername']+"]")

log('Plugin: '+pName+' '+pVersion+' successfully loaded.')
3 Likes