Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
wank
#1
fixed up a script found that no longer worked made for old school python. Now works for python3.x

import sys
import time
import argparse

if sys.version[0] == '2':
    print('Python 2.x is dying, use python3.x')
    print('https://pythonclock.org/')
    sys.exit()

parser = argparse.ArgumentParser()
parser.add_argument('-s','--stroke', default='short', metavar='STROKE_TIME', 
    choices=['short', 'medium', 'long'],
    help="Time frame of stroking. Options are 'short', 'medium', and 'long'. Default is short. ")
parser.add_argument('-f' , '--fasttrack', action='store_true',
    help='remove slow stroke start')
parser.add_argument('-d' , '--debug', action='store_true',
    help='debug mode')
parser.add_argument('-n' , '--nostroke', action='store_true',
    help='show jizz only')
parser.add_argument('-j','--jizz', default='short', metavar='JIZZ_TIME', 
    choices=['short', 'medium', 'fast'],
    help="Time frame of jizzing. Options are 'short', 'medium', and 'fast'. Default is short. ")
args = vars(parser.parse_args())

speed = .3
stroke = 0
speed_ind = 0
jizz_speed = .3

strokes = [
    "8=====MMD",
    "8====MM=D",
    "8===MM==D",
    "8==MM===D",
    "8=MM====D",
    "8MM=====D",
    "8=MM====D",
    "8==MM===D",
    "8===MM==D",
    "8====MM=D",
]

jizz_list = [
    "8====MM=D-",
    "8====MM=D --",
    "8====MM=D ---",
    "8====MM=D ---_",
    "8====MM=D --__",
    "8====MM=D -___",
    "8====MM=D ____"
]

speeds = [
    .3,
    .2,
    .1,
    .1,
    .1,
    .05,
    .05,
    .05,
    .05,
    .05,
    .05,
]

if args['stroke'] != 'short':
    if args['stroke'] == 'medium':
        num = 5
    else:
        num = 10
    
    for _ in range(num):
        speeds.insert(2, .1)
        speeds.insert(-1, .05)

if args['fasttrack']:
    speeds.pop(0)
    speeds.pop(0)
    
if args['jizz'] != 'short':
    if args['jizz'] == 'medium':
        jizz_speed = .1
    else:
        jizz_speed = .05
    

def is_end(index, seq):
    if index == len(seq)-1:
        return True

print('\n')
while True:
    if args['nostroke']:
        break
    frame = strokes[stroke]
    speed = speeds[speed_ind]
    if args['debug']:
        print('{}         SS:{} JS:{}'.format(frame, speed, jizz_speed), end='\r')
    else:
        print('{}'.format(frame), end='\r')
    time.sleep(speeds[speed_ind])
    if is_end(stroke, strokes):
        stroke = 0
        if is_end(speed_ind, speeds):
            break
        else:
            speed_ind += 1
    else:
        stroke += 1
        
for jizz in jizz_list:
    print('{}'.format(jizz), end='\r')
    time.sleep(jizz_speed)
print('\n')
print('\n')
Recommended Tutorials:
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020