• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Script Bank

32
Posts
4
Years
    • Seen Sep 19, 2023
    Code:
    def pbInteres
    time=pbGetTimeNow 
    hora=$game_variables[501]
    dinero=$game_variables[500]
    if $game_variables[501]!=time.hour
      
    case time.hour
    
    when 0..6
      inter=dinero*0.01
    when 7..12
      inter=dinero*0.10
    when 13..18
      inter=dinero*0.16
    when 19..24
      inter=dinero*0.23
      
    end
    $game_variables[502]=inter
    end
      
    end
    
    ###################################################################################
    def pbDepositar
      time=pbGetTimeNow 
      params=ChooseNumberParams.new
      params.setMaxDigits(9)
      params.setRange(1,$Trainer.money) 
      params.setInitialValue($Trainer.money) 
      params.setCancelValue(0)
         qty=Kernel.pbMessageChooseNumber(
          _INTL("Cuanto vas a depositar?"),params) 
         if qty>1
           $game_variables[500]+=qty
           $Trainer.money-=qty
           $game_variables[501]=time.hour
         else
           Kernel.pbMessage(_INTL("Actualmente no tienes dinero."))
           end
         end
         
    ###################################################################################     
    def pbRetirar
      pbInteres()
      pbConsultar()
      time=pbGetTimeNow 
      params=ChooseNumberParams.new
      params.setMaxDigits(9)
      params.setRange(100,$game_variables[500]) 
      params.setInitialValue(100) 
      params.setCancelValue(0)
      if $game_variables[500]>100
      qty=Kernel.pbMessageChooseNumber(_INTL("Cuanto deseas retirar?"),params) 
     
    if time.hour!=$game_variables[501]
     $Trainer.money+=qty+$game_variables[502].to_i
     $game_variables[500]-=qty+$game_variables[502].to_i
     $game_variables[501]=time.hour
      else
     $Trainer.money+=qty
     $game_variables[500]-=qty
     $game_variables[501]=time.hour
    end
    end
    
    end
    ###################################################################################
    
    def pbConsultar
      pbInteres
     if $game_variables[500]>0 
        Kernel.pbMessage(_INTL("depositaste a las {3} un total de: ${1} y has ganado {2} de intereses",$game_variables[500],$game_variables[502].to_i,$game_variables[501]))
      else
        Kernel.pbMessage(_INTL("Saldo Insuficiente"))
      end
      end	  
    ###################################################################################
    
    ItemHandlers::UseFromBag.add(:Cuentadeahorros,proc{|item|
      pbConsultar
    })
     
    29
    Posts
    8
    Years
    • Seen Oct 16, 2021
    Not to be rude but why are you just posting scripts with no context as to what they do?
     

    #Not Important

    All hail the wishmaker
    910
    Posts
    4
    Years
  • I can help here:
    This is actually an amazing script!
    It replicates the way your mother stores money for you in Gold/Silver/Crystal
    In-depth:
    pbInteres adds an interest function to game, meaning that any saved money will multiply by a small amount every time you run the code.
    pbDepositar is made to add money to your bank "account".
    pbRetirar is made to take money away from your "account".
    pbConsultar is made to check your balance.
    All of these are kept in game variables: 500,501 and 502.
    Code:
    ItemHandlers::UseFromBag.add(:Cuentadeahhoros,proc{|item|
      pbConsultar
    })
    That adds an item effect that runs pbConsultar when used.
    Will translate into english.
     
    Back
    Top