首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

芭芭农场自动脚本_农场游戏源码

大家好,又见面了,我是你们的朋友全栈君。 特此声明:此版本校内开心农场外挂由python语言编写,运行平台为linux。本代码是修改网络上流传的源码而成,本人贴出此代码没有任何利益想法,只当学习交流之用,并感谢源码开发者! #!/usr/bin/env python #encoding: utf-8 #2009-8-21 升级后 import urllib,urllib2,cookielib import time,zlib,re,md5 import cStringIO,gzip import json import pickle import thread,sys,os class Farm: debug=False status={} #self’s farm status friends={} #list of friends shop={} #information of seeds bag={} #背包 uid=0 #user id autoweed=True #自动除草 autonorm=True #自动杀虫 autowater=True #自动浇水 autofert=True #自动施肥 autoplant=True #自动种植 autosteal=True #自动收获 #创建Cookie def __init__(self): cj=cookielib.LWPCookieJar() opener=urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) opener.addheaders=[(‘User-agent’,’Opera/9.23′)] urllib2.install_opener(opener) # 请求网页的工具函数,直接返回网页内容 def req(self,url,body=()): if len(body)==0: req=urllib2.Request(url) else: req=urllib2.Request(url,urllib.urlencode(body)) while True: try: raw=urllib2.urlopen(req) break except: print ‘ReqError url:%s’ % url pass if self.debug: #输出调试信息 print url print body return raw.read() def param(self): # build params farmKey and farmTime farmTime=str(time.time())[0:10] farmKey=md5.md5(farmTime+’15l3h4kh’).hexdigest() return (farmKey, farmTime) # 登录校内网 获取校内网到开心网的链接地址,并取得Cookie def login(self, email, password): url=” http://passport.renren.com/

01
领券