cRPG

cRPG => General Discussion => Topic started by: Tophat on February 09, 2011, 04:42:05 pm

Title: I made a script!
Post by: Tophat on February 09, 2011, 04:42:05 pm
Hello forums! I made a pretty basic script in python that tells you how much gold/xp you need to buy an item/level up based on your multiplier.
Code: [Select]
# Hi forums!
a = raw_input("Gold or XP?")
if a == "xp":
    b = input("How much xp until next level?")
    c = input("How much xp do you have?")
    d = input("1000, 2000, 3000, 4000, or 5000 per round?")
    print ((b - c) / d)
if a == "gold":
    b = input("How much does it cost?")
    c = input("How much do you have?")
    d = input("50 per round, 100 per round, 150 per round, 200 per round, or 250 per round?")
    print ((b - c) / d)
Title: Re: I made a script!
Post by: Engine on February 09, 2011, 04:48:11 pm
Hey, good job. Stats are fun. How do you use it?
Title: Re: I made a script!
Post by: krampe on February 09, 2011, 04:52:38 pm
get Python at http://www.python.org/download/
install
write in commandbox: python nameofscript.py
:P

visitors can't see pics , please register or login
Title: Re: I made a script!
Post by: Tophat on February 09, 2011, 04:55:24 pm
You need Python, so as soon as you get that installed copy the code into notepad and save it as a .py file. Then all you have to do is double click it.
You can download it here http://www.python.org/download/
Title: Re: I made a script!
Post by: Tophat on February 09, 2011, 05:02:02 pm
Oops, I forgot one thing.
It exits as soon as it's done, so this will make it stay open, although be it's pretty crude, so be warned.
Code: [Select]
# Hi forums!
a = raw_input("Gold or XP?")
if a == "xp":
    b = input("How much xp until next level?")
    c = input("How much xp do you have?")
    d = input("1000, 2000, 3000, 4000, or 5000 per round?")
    e =  ((b - c) / d)
    f = input (e)
if a == "gold":
    b = input("How much does it cost?")
    c = input("How much do you have?")
    d = input("50 per round, 100 per round, 150 per round, 200 per round, or 250 per round?")
    e =  ((b - c) / d)
    f = input (e)
EDIT: Forgot some stuff
Title: Re: I made a script!
Post by: krampe on February 09, 2011, 05:05:24 pm
It is per minute by the way ;D
Title: Re: I made a script!
Post by: Tophat on February 09, 2011, 05:11:42 pm
Oh, thanks! I was wondering that.
Title: Re: I made a script!
Post by: Meow on February 09, 2011, 07:06:30 pm
you sir have a very nice tophat  :mrgreen:

thx :P
Title: Re: I made a script!
Post by: Vibe on February 11, 2011, 02:47:47 pm
Fixed for command prompt viewing pleasures
Code: [Select]
# Hi forums!
a = raw_input("Gold or XP? ")
if a == "xp":
    b = input("How much xp until next level? ")
    c = input("How much xp do you have? ")
    d = input("1000, 2000, 3000, 4000, or 5000 per round? ")
    e =  ((b - c) / d)
    f = input (e)
if a == "gold":
    b = input("How much does it cost? ")
    c = input("How much do you have? ")
    d = input("50 per round, 100 per round, 150 per round, 200 per round, or 250 per round? ")
    e =  ((b - c) / d)
    f = input (e)