I have uploaded the binary distributable for 0.1.3 to the first post. If you are a Windows user can just download that and run the exe, which will install it automatically.
def Msg(mso):
msgt = mso["Msg"]
if msgt == "eTS.NadeoSvK : ^L!test":
SendMessage("/msg " + msgt)
if mso["UCID"] != 0 and msgt == "eTS.NadeoSvK : ^L!test":
if mso["UCID"] != 0 [B]and[/B] msgt == "eTS.NadeoSvK : ^L!test":
isi = Packet(ISP_ISI, ReqI=1, Admin="FishDance", IName="Pyinsim")
isi["Prefix"] = "!" # This works now!
insim.sendP(isi, tiny, mst)
<?xml version="1.0" encoding="utf-8"?>
<Pyinsim>
<Packet Name="Init">
<ReqI>1</ReqI>
<UDPPort>0</UDPPort>
<Admin>Pass</Admin>
<IName>Pyinsim</IName>
<Prefix>$</Prefix>
</Packet>
<Packet Name="HelloMsg">
<Msg>Hello, world!</Msg>
</Packet>
</Pyinsim>
xmlFile = "Packets.xml"
isi = packetXml(ISP_ISI, "Init", xmlFile)
mst = packetXml(ISP_MST, "HelloMsg", xmlFile)
insim.sendP(isi, mst)
from pyinsim import *
insim = InSim()
def messageReceived(insim, mso):
command = parseCommand(mso, '!')
if command[0] == "help":
print 'Help command'
elif command[0] == "admin":
print 'Admin command'
elif command[0] == "report":
print 'Report', command[1]
insim.Bind(ISP_MSO, MessageReceived)
try:
insim.connect("127.0.0.1", 29999)
except Exception, (msg):
print "Error:", msg
else:
insim.send(ISP_ISI, Admin="Pass", IName="Pyinsim")
insim.run()
finally:
insim.close()
InSim.SendP(self, Packet(ISP_BTN, ReqI=1, ClickID=0, UCID=ucid,
BStyle=ISB_DARK, W=40, H=10, T=30, L=5, Text=speed))
insim.SendP(Packet(ISP_ISI, Admin="Pass", IName="Pyinsim", Flags=ISF_LOCAL))
insim.SendP(Packet(ISP_ISI, Admin="Pass", IName="Pyinsim"))