def process_wheelofknol(self):
#Process wheel of knoledge
print "knol"
self.wheelofknoltime = time.time()
self.newsql.setsetting("wheelofknoltime",time.time ()) #Save Settings
self.gateway = RemotingService('http://www.neopets.com/amfphp/gateway.php')
self.gateway.opener = self.acc.opener.open
WheelService = self.gateway.getService('WheelService')
html = WheelService.spinWheel("1")
if (html.find("You win a free spin.")) > 1:
self.process_wheelofknol()
###bad logic
elif (html.find("'slot': 12")) > 1:
return 1 # just a game tip , no dice
elif (html.find("'slot': 8")) > 1:
return 1 # just a game tip , no dice
elif (html.find("Your Neopet has been healed")) > 1:
html="Active Neopet Healed"
sql = "INSERT INTO dailylogs(id,logname, logresult , userid , username) VALUES (NULL,'Wheel Of Knoledge','%s','%s','%s')" % (html,str(self.theuserid),self.acc.user)
self.newsql.insertsql(sql)
elif (html.find("Not everyone is as lucky as you")) > 1:
html="Won item (standard)"
sql = "INSERT INTO dailylogs(id,logname, logresult , userid , username) VALUES (NULL,'Wheel Of Knoledge','%s','%s','%s')" % (html,str(self.theuserid),self.acc.user)
self.newsql.insertsql(sql)
print html
extrainfo= ""
filename = "wheelofknol_" + str(time.time())
self.writestringtofile(filename,html)