Skip to content

Instantly share code, notes, and snippets.

@exzhawk
Last active August 29, 2015 14:11
Show Gist options
  • Save exzhawk/8ba7b26440b5c07c8a9e to your computer and use it in GitHub Desktop.
Save exzhawk/8ba7b26440b5c07c8a9e to your computer and use it in GitHub Desktop.
nnhysj
# coding:utf8
import random
from time import sleep
import requests
session_id = '98f5e6f5a7f711e4ae1700163e0243c6'
did = '352005048247251'
client = '2'
client_ver = '3.4.1'
network = '1'
client_os_ver = '19'
tasks = [
['101', '9', '11502,11370,11220,10410,10629,12253,10112,10044,11452,10591,12254,11338'],
['133', '2', '11023,11220,10027,10232,11208,10241,10576,11163,11191,10498,10396,10207,12254,11343'],
['171', '12', '11028,11066,11220,11208,11305,10576,11163,11191,11164,10396,10207,12254,11343'],
['42', '4', '11028,11066,11466,11208,11270,11175,11180,11174,10498,10396,10292,10290,10504,10961'],
['55', '6', '10155,11220,10371,11425,11210,11270,11175,11180,11174,10498,10396,10583,10128,10289,10961,11338'],
['52', '5', '10980,11066,11220,11210,11270,11175,11180,11174,11164,10591,10672,10290,10504,10948,11338'],
['177', '13', '10980,11444,11220,11206,11270,12253,10112,10044,11452,10591,10672,10290,10948,11338'],
['178', '13', '11023,11066,11220,11208,11270,11175,11180,11174,11164,10396,10583,10290,10289,10961,11338'],
['179', '14', '11023,11370,10892,10130,10456,12253,10299,11149,11452,10672,10290,10504,10939,11338'],
['202', '15', '10980,11370,11461,10130,10456,11178,10112,10044,11452,10672,10290,10504,10939,11338'],
['220', '17', '11023,11051,11461,11207,10456,11178,10112,10044,11452,11338'],
['14', '2', '11037,11084,11662,11256,11202,10696,11188,11180,11174,11452,10396,10583,12064,10289,10959,11343']
]
# tasks = [
# ['1027', '106', '10980,11066,11560,10970,10456,10508,11452,10290,10504,10939,11338'],
# ['1024', '106', '11028,11066,11084,11208,11305,10111,11163,11174,11549,10583,10128,10504,10961,11338']
# ]
baseURL = 'http://223.6.250.239'
global c, s
c = 0
s = 0
def task(task_id, map_id, dress):
print task_id
data = {'session_id': session_id, 'did': did, 'client': client, 'client_ver': client_ver, 'network': network,
'client_os_ver': client_os_ver,
'task_id': task_id, 'map_id': map_id}
r = requests.post(baseURL + '/x/2/task/set', data=data, timeout=60)
print(r.text)
data = {'session_id': session_id, 'did': did, 'client': client, 'client_ver': client_ver, 'network': network,
'client_os_ver': client_os_ver,
'task_id': task_id, 'dress': dress}
r = requests.post(baseURL + '/x/2/task/do', data=data, timeout=60)
global s
s += 1
if r.text.find('30227') != -1:
global c
c += 1
print(r.text)
data = {'session_id': session_id, 'did': did, 'client': client, 'client_ver': client_ver, 'network': network,
'client_os_ver': client_os_ver}
r = requests.post(baseURL + '/x/2/user/power/regain', data=data, timeout=60)
print(r.text)
# r=requests.get('%s/x/2/user/get?session_id=%s&did=%s&client=%s&client_ver=%s&network=%s&client_os_ver=%s'%(baseURL,session_id,did,client,client_ver,network,client_os_ver))
# print(r.text)
print('[' + str(c) + ' / ' + str(s) + '] \t=================================')
def sleepn():
t = 721
sleep(random.randint(t, t + 60))
# 完成taskInfo中的任务, 刷钱/刷物品用
def main():
c = 1
while True:
for taskInfo in tasks:
try:
task(taskInfo[0], taskInfo[1], taskInfo[2])
sleepn()
task(taskInfo[0], taskInfo[1], taskInfo[2])
sleepn()
except:
pass
# break
# 自动梦之阁50连抽
def main2():
while True:
r = requests.get(
'%s/x/2/lottery/do?session_id=%s&did=%s&client=%s&client_ver=%s&network=%s&client_os_ver=%s&lot=2&count=50' % (
baseURL, session_id, did, client, client_ver, network, client_os_ver))
print(r.text)
sleep(random.randint(10, 30))
break
pass
# 自动刷许愿星
def main3():
data = {'session_id': session_id, 'did': did, 'client': client, 'client_ver': client_ver, 'network': network,
'client_os_ver': client_os_ver, 'task_id': '1028', 'grade': 'B', 'dress_list': '11499,11371,10884,10528'}
r = requests.post(baseURL + '/x/2/stask/do', data=data, timeout=60)
print(r.text)
data = {'session_id': session_id, 'did': did, 'client': client, 'client_ver': client_ver, 'network': network,
'client_os_ver': client_os_ver}
r = requests.post(baseURL + '/x/2/user/power/regain', data=data, timeout=60)
print(r.text)
data = {'session_id': session_id, 'did': did, 'client': client, 'client_ver': client_ver, 'network': network,
'client_os_ver': client_os_ver}
r = requests.post(baseURL + '/x/2/sactivity/resort/favor/prize', data=data, timeout=60)
print(r.text)
r = requests.get(
'%s/x/2/sactivity/resort/favor?session_id=%s&did=%s&client=%s&client_ver=%s&network=%s&client_os_ver=%s' % (
baseURL, session_id, did, client, client_ver, network, client_os_ver))
print(r.text)
sleepn()
if __name__ == '__main__':
# main()
# main2()
main3()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment