Bitcoin Forum
November 04, 2024, 10:21:45 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 6 7 8 [9] 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 ... 62 »
  Print  
Author Topic: Seuntjie' Dice bot programmers mode discussion.  (Read 125384 times)
The_Prof
Sr. Member
****
Offline Offline

Activity: 345
Merit: 250



View Profile
April 16, 2016, 08:19:16 PM
 #161

OK, so I have this...

Code:
if (balance) >= profittarget then
stop();
print(balance)
print("TARGET ACHIEVED!!!")
end

Which is useful to stop on the small chance I ever actually hit the target. Though it seems I am starting to get closer...I am forever hopeful. My goal is to not have a negative for my overall profit. My question is as I seem to be failing is what would I put for it to withdraw a certain amount once it hits target and then just carries on?

Thanks.

Look over there...
chilly2k (OP)
Legendary
*
Offline Offline

Activity: 1007
Merit: 1000


View Profile
April 16, 2016, 09:14:10 PM
 #162

OK, so I have this...

Code:
if (balance) >= profittarget then
stop();
print(balance)
print("TARGET ACHIEVED!!!")
end

Which is useful to stop on the small chance I ever actually hit the target. Though it seems I am starting to get closer...I am forever hopeful. My goal is to not have a negative for my overall profit. My question is as I seem to be failing is what would I put for it to withdraw a certain amount once it hits target and then just carries on?

Thanks.

There is a withdraw function.  I believe it's withdraw(amount, address)   Might be the reverse.

So you might code withdraw(profittarget,bitcoinaddress). 

The code will continue.  I code that a lot.  Usually I'll tip to another user ID, since the amount I'm playing with is usually very small. 

A note, the balance isn't usually updated after the withdrawal.  It's usually OK after the next bet, but you might have ad some checks so your not trying to withdraw over and over.   

The_Prof
Sr. Member
****
Offline Offline

Activity: 345
Merit: 250



View Profile
April 17, 2016, 01:43:45 AM
Last edit: April 17, 2016, 11:06:09 AM by The_Prof
 #163

Will give it a try and see how it goes.

Thanks again.

Edit:

Code:
if (balance) >= profittarget then
stop();
print(balance)
print("TARGET ACHIEVED!!!")
withdraw(0.0102,1GgmLevW6nc3j6wsRurvJWu1Y8s3cnAK1j)
start()
end


Sadly it doesn't work, tried swapping them round and putting spaces everywhere. I get this error...

')' expected, got '1GgmLevW6nc3j6wsRurvJWu1Y8s3cnAK1j'

Look over there...
seuntjie
Legendary
*
Offline Offline

Activity: 1717
Merit: 1125



View Profile WWW
April 17, 2016, 02:07:09 PM
 #164

Will give it a try and see how it goes.

Thanks again.

Edit:

Code:
if (balance) >= profittarget then
stop();
print(balance)
print("TARGET ACHIEVED!!!")
withdraw(0.0102,1GgmLevW6nc3j6wsRurvJWu1Y8s3cnAK1j)
start()
end


Sadly it doesn't work, tried swapping them round and putting spaces everywhere. I get this error...

')' expected, got '1GgmLevW6nc3j6wsRurvJWu1Y8s3cnAK1j'

The address is a string value and not a variable, so it needs to be in apostrophes.

withdraw(amount:double,address:string)
ie: withdraw(0.0102,'1GgmLevW6nc3j6wsRurvJWu1Y8s3cnAK1j')

The_Prof
Sr. Member
****
Offline Offline

Activity: 345
Merit: 250



View Profile
April 17, 2016, 03:16:32 PM
Last edit: April 17, 2016, 06:21:59 PM by The_Prof
 #165

Will give it a try and see how it goes.

Thanks again.

Edit:

Code:
if (balance) >= profittarget then
stop();
print(balance)
print("TARGET ACHIEVED!!!")
withdraw(0.0102,1GgmLevW6nc3j6wsRurvJWu1Y8s3cnAK1j)
start()
end


Sadly it doesn't work, tried swapping them round and putting spaces everywhere. I get this error...

')' expected, got '1GgmLevW6nc3j6wsRurvJWu1Y8s3cnAK1j'

The address is a string value and not a variable, so it needs to be in apostrophes.

withdraw(amount:double,address:string)
ie: withdraw(0.0102,'1GgmLevW6nc3j6wsRurvJWu1Y8s3cnAK1j')


Thanks, that seems to work. Guess we will all know in a few hours.

Code:
if (balance) >= profittarget then
stop();
print("   ")
print(balance)
print("TARGET ACHIEVED!!!")
print("  ")
withdraw(0.0102,'15TCN7KM6eAAaWj29uEGxUXceMXLSxg1fx')
withdraw(0.0012,'1J4ZM3JcUa8rob2Fyum4vWoQvKjaWVnb1T')
withdraw(0.0012,'13DBotnDHGZBUt5ZWLfJe6Q5RN9nGJVFPQ')
start()
end

This code will stay there till I decide to start changing things again. But there is a small bit there for you both to show my appreciation.  Lets hope for the best.


PS. If anyone feels like putting in this code in their scripts I won't mind...but you mustn't change a thing...haha



Edit:

Lame...withdrawels worked. Didn't start. Came up with...

[string "chunk"]:20: attempt to call global 'start' (a nil value)

So I put in: nextbet=0.0000001

Hope that helps, will find out in a while


Edit 2:
Removing the stop and start it carries on going however it only does one withdraw. The first one. Do I need to put something in between to get the 2nd and third one going as well. It shows like it worked but doesn't actually make the transaction.

Look over there...
seuntjie
Legendary
*
Offline Offline

Activity: 1717
Merit: 1125



View Profile WWW
April 17, 2016, 06:51:02 PM
Last edit: April 18, 2016, 03:02:13 PM by seuntjie
 #166

Most sites limit the number of withdrawal you can make for a period of time. PD for instance only allows 1 withdrawal per minute (and also only 1 seed reset per minute, these might be aggregate).

You'll need to pause the script for a minute and a few seconds between each withdrawal.

Re-start error: Start isn't actually seen or handles as a LUA function (which in hind sight was extremely stupid), so it will not work when inside a script, only from the console.

Edit: How about doing the withdrawals in a round robin style? Make it withdraw x to address 1, play on, when you reach your target, make it withdraw x to address 2, then play on until you reach your target and make it withdraw to address 3, then start over again.

You could do something like:

Code:
--define lastWithdraw=1 at the start of the script, outside of dobet()

if (balance) >= profittarget then
stop();
print("   ")
print(balance)
print("TARGET ACHIEVED!!!")
print("  ")
if lastWithdraw==3 then
withdraw(0.0102,'15TCN7KM6eAAaWj29uEGxUXceMXLSxg1fx')
lastWithdraw=1
elseif lastWithdraw==1 then
withdraw(0.0012,'1J4ZM3JcUa8rob2Fyum4vWoQvKjaWVnb1T')
lastWithdraw=2
else
withdraw(0.0012,'13DBotnDHGZBUt5ZWLfJe6Q5RN9nGJVFPQ')
lastWithdraw=3
end
start()
end


This is a very simple way of doing it. It'd probably be better to define an array of addresses and have it step through it in a sense, and then reset the counter when you reach the end of the array

The_Prof
Sr. Member
****
Offline Offline

Activity: 345
Merit: 250



View Profile
April 18, 2016, 04:41:37 PM
 #167

Thanks,  will give it a try. I did what you said and used the timer.

Came up with...

Code:
if (balance) >= profittarget then
print("   ")
print(balance)
print("TARGET ACHIEVED!!!")
print("  ")
withdraw(0.0102,'15TCN7KM6eAAaWj29uEGxUXceMXLSxg1fx')
sleep(61000)
withdraw(0.0012,'1J4ZM3JcUa8rob2Fyum4vWoQvKjaWVnb1T')
sleep(61000)
withdraw(0.0012,'13DBotnDHGZBUt5ZWLfJe6Q5RN9nGJVFPQ')
end

The above did work but yours looks like fun. Might remove all the print stuff at some point. It's entertaining self gratification but I might get bored of it eventually. I did it without the start stop bit as it is actually unnecessary. But coding is not my strong point as I am sure you have noticed. My knowledge swings more to the hardware side. SO all the little bits and pieces you put in are a way for me to learn.

Thanks again.

Look over there...
ravioliren11
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
April 21, 2016, 07:16:54 PM
 #168

Can anyone give me a code to increase bet speed? Seems like 999dice is betting waaay slower than other dice sites. Would appreciate it thanks Smiley
seuntjie
Legendary
*
Offline Offline

Activity: 1717
Merit: 1125



View Profile WWW
April 21, 2016, 08:34:32 PM
 #169

Can anyone give me a code to increase bet speed? Seems like 999dice is betting waaay slower than other dice sites. Would appreciate it thanks Smiley

Will you exercising and running 10km a day make me run any faster?

ravioliren11
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
April 21, 2016, 09:46:10 PM
 #170

Thanks man, good work..

   I ran that just like above.  Personally, decrementing the win till it's zero seemed like a waste of a lot of winning bets.  Also I changed the win/lose multipliers.  At 77.7% you should be winning about 3 out of 4 bets.  With the multipliers I've set it take 2.5 wins to recover from 1 lose. Also by setting the lose multiplier down to 1.5 it doesn't get too out of hand.  I also added a stop on win function, and invest function.  Since there is no check to keep from busting I wanted to strip off some winnings before it busts.    

    This is on JD, so you might have to comment out the invest function if your using on a site that doesn't invest.  

Code:
chance=77.7
multiplier=1.5
multiplier2=0.92
base=0.0000150
nextbet = base  
bethigh = false
target = .00005
investtarget = .001
tmpprofit = 0
investprofit = 0
wincount = 10
stopnow = false

function dobet()

tmpprofit += currentprofit
investprofit += currentprofit

   if win then
      if (tmpprofit > target) then
         tmpprofit = 0
         nextbet = base
         if(stopnow) then stop() end
         if(investprofit  > investtarget ) then
             investprofit = 0
             invest(investtarget)
         end      
      else
         nextbet=previousbet*multiplier2
         if(nextbet < base) then nextbet = base end
      end
   else
      nextbet=previousbet*multiplier
      if(nextbet < base) then nextbet = base end
   end
end

to comment out a line just put -- in the first spaces of the line.  

  so to comment this out.

             investprofit = 0

 put

--             investprofit = 0

https://i.imgur.com/s0kBRSP.png

The worse case lose I had to cover so far was .005 , So far I seems to work well...  

edit: forgot to mention.  When your in a lose streak, it keeps increasing your bets.  Once it starts winning then back, it will reset to the base bet before it actually reaches that.  So even thought you seem to be down quite a bit, it only take a few wins (8-10) at the higher bet, to get back in the green.   

Okey so i tried this script just to experiment and see how investing works in a dice site that has invest. Tried it on safedice but when i reach the target where it'll invest it didnt invest? Although in the console it did say 'Investing 0.001' but when i checked safedice under Invest tab it was zero? Or am i missing something about how investing works in a dicesite?
ravioliren11
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
April 21, 2016, 09:55:42 PM
 #171

Can anyone give me a code to increase bet speed? Seems like 999dice is betting waaay slower than other dice sites. Would appreciate it thanks Smiley

Will you exercising and running 10km a day make me run any faster?

Lol guess not..Just wanted to ask since other sites seems to bet alot faster xD
Lutpin
Copper Member
Legendary
*
Offline Offline

Activity: 1904
Merit: 1874


Goodbye, Z.


View Profile WWW
April 21, 2016, 09:57:25 PM
 #172

Can anyone give me a code to increase bet speed? Seems like 999dice is betting waaay slower than other dice sites. Would appreciate it thanks Smiley
Will you exercising and running 10km a day make me run any faster?
Lol guess not..Just wanted to ask since other sites seems to bet alot faster xD
Maybe you should then consider betting on another site (if speed is of such an essence to you) rather than searching for 'a code to increase bet speed' on the limited site.

▄▄█████████▄▄
▄█████████████████▄
▄████▀▀▀▀█████▀▀▀▀████▄
████▀██████▀█▀██████▀████
██████████████████████████
▐█████▄███████████████▄█████▌
▐███████▄▄█████████▄▄███████▌
▐██████▀█████████████▀██████▌
▐███████████████████████████▌
▀██████████████████████▀
▀████▄████▄▀▀▄████▄████▀
▀███████▀███▀███████▀
▀▀█████████████▀▀
  ▀▀▀▀▀▀▀▀▀
   ███████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
███████



             ▄████████████████████████████████████████████████████████████▄
            ██                          ▄▄▄▄▄▄                           ██
           ██  ██████                ▄██████████▄     ████████████████████▀
          ██  ████████             ▄████▀   ▀████▄    ████▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
         ██  ████  ████           ████▀       ▀██▀    ████
        ██  ████    ████        ▄███▀                 ████

       ██  ████      ████       ███▀                  ████▄▄▄▄▄▄▄▄▄▄
      ██  ████        ████      ███                   ██████████████
     ██  ████          ████     ███▄                  ████▀▀▀▀▀▀▀▀▀▀

    ██  ████████████████████    ▀████                 ████
   ██  ██████████████████████    ▀████▄        ▄██▄   ████

  ██  ████                ████     ▀████▄   ▄████▀    ████▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
 ██  ████                  ████      ▀██████████▀     ████████████████████▄
  ██                                    ▀▀▀▀▀▀                           ██
   ▀█████████████████████████████████████████████████████████████████████▀
ravioliren11
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
April 21, 2016, 10:04:25 PM
 #173

Can anyone give me a code to increase bet speed? Seems like 999dice is betting waaay slower than other dice sites. Would appreciate it thanks Smiley
Will you exercising and running 10km a day make me run any faster?
Lol guess not..Just wanted to ask since other sites seems to bet alot faster xD
Maybe you should then consider betting on another site (if speed is of such an essence to you) rather than searching for 'a code to increase bet speed' on the limited site.
Ermm im not exactly saying its an issue or anything xD Just wondering is all since other site bets faster..If the site itself was made to bet at that speed then so be it XD
I was just asking. Apologies if anyone got offended xD
seuntjie
Legendary
*
Offline Offline

Activity: 1717
Merit: 1125



View Profile WWW
April 21, 2016, 10:33:02 PM
 #174

Can anyone give me a code to increase bet speed? Seems like 999dice is betting waaay slower than other dice sites. Would appreciate it thanks Smiley
Will you exercising and running 10km a day make me run any faster?
Lol guess not..Just wanted to ask since other sites seems to bet alot faster xD
Maybe you should then consider betting on another site (if speed is of such an essence to you) rather than searching for 'a code to increase bet speed' on the limited site.
Ermm im not exactly saying its an issue or anything xD Just wondering is all since other site bets faster..If the site itself was made to bet at that speed then so be it XD
I was just asking. Apologies if anyone got offended xD


999dice has some horrible throttles. The only way to bet faster is to bet bigger

seuntjie
Legendary
*
Offline Offline

Activity: 1717
Merit: 1125



View Profile WWW
April 21, 2016, 10:33:57 PM
 #175

Thanks man, good work..

   I ran that just like above.  Personally, decrementing the win till it's zero seemed like a waste of a lot of winning bets.  Also I changed the win/lose multipliers.  At 77.7% you should be winning about 3 out of 4 bets.  With the multipliers I've set it take 2.5 wins to recover from 1 lose. Also by setting the lose multiplier down to 1.5 it doesn't get too out of hand.  I also added a stop on win function, and invest function.  Since there is no check to keep from busting I wanted to strip off some winnings before it busts.    

    This is on JD, so you might have to comment out the invest function if your using on a site that doesn't invest.  

Code:
chance=77.7
multiplier=1.5
multiplier2=0.92
base=0.0000150
nextbet = base  
bethigh = false
target = .00005
investtarget = .001
tmpprofit = 0
investprofit = 0
wincount = 10
stopnow = false

function dobet()

tmpprofit += currentprofit
investprofit += currentprofit

   if win then
      if (tmpprofit > target) then
         tmpprofit = 0
         nextbet = base
         if(stopnow) then stop() end
         if(investprofit  > investtarget ) then
             investprofit = 0
             invest(investtarget)
         end      
      else
         nextbet=previousbet*multiplier2
         if(nextbet < base) then nextbet = base end
      end
   else
      nextbet=previousbet*multiplier
      if(nextbet < base) then nextbet = base end
   end
end

to comment out a line just put -- in the first spaces of the line.  

  so to comment this out.

             investprofit = 0

 put

--             investprofit = 0



The worse case lose I had to cover so far was .005 , So far I seems to work well...  

edit: forgot to mention.  When your in a lose streak, it keeps increasing your bets.  Once it starts winning then back, it will reset to the base bet before it actually reaches that.  So even thought you seem to be down quite a bit, it only take a few wins (8-10) at the higher bet, to get back in the green.   

Okey so i tried this script just to experiment and see how investing works in a dice site that has invest. Tried it on safedice but when i reach the target where it'll invest it didnt invest? Although in the console it did say 'Investing 0.001' but when i checked safedice under Invest tab it was zero? Or am i missing something about how investing works in a dicesite?

I haven't tested the investing at safedice via the API in ages. It's possible (likely
) that it doesn't work.

ravioliren11
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
April 21, 2016, 10:54:28 PM
 #176

Thanks man, good work..

   I ran that just like above.  Personally, decrementing the win till it's zero seemed like a waste of a lot of winning bets.  Also I changed the win/lose multipliers.  At 77.7% you should be winning about 3 out of 4 bets.  With the multipliers I've set it take 2.5 wins to recover from 1 lose. Also by setting the lose multiplier down to 1.5 it doesn't get too out of hand.  I also added a stop on win function, and invest function.  Since there is no check to keep from busting I wanted to strip off some winnings before it busts.    

    This is on JD, so you might have to comment out the invest function if your using on a site that doesn't invest.  

Code:
chance=77.7
multiplier=1.5
multiplier2=0.92
base=0.0000150
nextbet = base  
bethigh = false
target = .00005
investtarget = .001
tmpprofit = 0
investprofit = 0
wincount = 10
stopnow = false

function dobet()

tmpprofit += currentprofit
investprofit += currentprofit

   if win then
      if (tmpprofit > target) then
         tmpprofit = 0
         nextbet = base
         if(stopnow) then stop() end
         if(investprofit  > investtarget ) then
             investprofit = 0
             invest(investtarget)
         end      
      else
         nextbet=previousbet*multiplier2
         if(nextbet < base) then nextbet = base end
      end
   else
      nextbet=previousbet*multiplier
      if(nextbet < base) then nextbet = base end
   end
end

to comment out a line just put -- in the first spaces of the line.  

  so to comment this out.

             investprofit = 0

 put

--             investprofit = 0

https://i.imgur.com/s0kBRSP.png

The worse case lose I had to cover so far was .005 , So far I seems to work well...  

edit: forgot to mention.  When your in a lose streak, it keeps increasing your bets.  Once it starts winning then back, it will reset to the base bet before it actually reaches that.  So even thought you seem to be down quite a bit, it only take a few wins (8-10) at the higher bet, to get back in the green.   

Okey so i tried this script just to experiment and see how investing works in a dice site that has invest. Tried it on safedice but when i reach the target where it'll invest it didnt invest? Although in the console it did say 'Investing 0.001' but when i checked safedice under Invest tab it was zero? Or am i missing something about how investing works in a dicesite?

I haven't tested the investing at safedice via the API in ages. It's possible (likely
) that it doesn't work.
Yeap its not working. Tried it with a few small investing targets just to confirm :/
grendel25
Legendary
*
Offline Offline

Activity: 2296
Merit: 1031



View Profile
April 22, 2016, 03:57:34 AM
 #177

Good evening. 

After I lose a bet, how would I double the lost bet and calculate the multiplier of the next bet to win the amount that I lost in the previous games?  However, the multiplier should never exceed a certain amount (such as 2x multiplier)

..EPICENTRAL .....
..EPIC: Epic Private Internet Cash..
.
.
▄▄█████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄████████████████▀▀█████▄
▄████████████▀▀▀    ██████▄
████████▀▀▀   ▄▀   ████████
█████▄     ▄█▀     ████████
████████▄ █▀      █████████
▀████████▌▐       ████████▀
▀████████ ▄██▄  ████████▀
▀█████████████▄███████▀
▀█████████████████▀
▀▀█████████▀▀
.
▄▄█████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄████████▀█████▀████████▄
▄██████▀  ▀     ▀  ▀██████▄
██████▌             ▐██████
██████    ██   ██    ██████
█████▌    ▀▀   ▀▀    ▐█████
▀█████▄  ▄▄     ▄▄  ▄█████▀
▀██████▄▄███████▄▄██████▀
▀█████████████████████▀
▀█████████████████▀
▀▀█████████▀▀
.
.
[/center]
L3gionario
Sr. Member
****
Offline Offline

Activity: 397
Merit: 250



View Profile
April 27, 2016, 08:12:10 PM
 #178

Hi all guys...i have see this theread:

https://bitcointalk.org/index.php?topic=1430193.0

Think is very interesting, but think i can't use this method with bot...
anyone can write a script for this?

Thanks in advance

        ████████████████████████       
      ████████████████████████        
    ░████████████████████████         
   ██████            ░█████▓          
  ██████   ████████████████████████░  
   ██████ ████████████████████████    
    █████████████████████████████     
     ▒███████░  ░█████▒  ░█████▓      
       █████   ██████   ██████        
        ███   ██████   ██████   ██████
         ░   ██████   ██████   ██████ 
           ██████░  ░█████▒  ░██████  
          ██████   ██████   ██████    
         ████████████████████████     
       ░████████████████████████      
      ████████████████████████▒       
              ██████                  
             ██████                   
           ░█████▓    
██▀
▐▌
▐║
▐║
▐▌
██▄
▀██
▐▌
║▌
║▌
▐▌
▄██
─── SOCIAL MEDIA ───
Facebook Twitter  YouTube 
Telegram  Reddit  LinkedIn
wormat22
Full Member
***
Offline Offline

Activity: 224
Merit: 100


View Profile
April 29, 2016, 06:42:15 PM
 #179

I'm getting this error on my script...can't figure out where the problem is?

[string "chunk"]:32: attempt to compare number with nil


Here's the script:
Code:
  basebet = balance/500
  nextbet = basebet
  roundprofit = 0
  chance = 87.79
  maxbal=balance+0.01500000
  ProtectedProfit = .0003
  reset = false
  firstgame = true

  function dobet()

    roundprofit += currentprofit

    if (win) then
      if(profit > (ProtectedProfit*1.2)) then
        ProtectedProfit = ProtectedProfit*1.2
      end
      if(profit <= (ProtectedProfit/4)) then
        ProtectedProfit = ProtectedProfit/2
        if(ProtectedProfit < .000150) then
          ProtectedProfit = .000150
        end
      end
      if (roundprofit < 0) and (!reset) then
        nextbet = previousbet + basebet
        print ("WIN")
      print(nextbet)
      end
    else
      nextbet = basebet
      print ("WIN")
    print(nextbet)
      reset = false
    end
   
    if balance<minbal then
      stop()
    end
   
    if balance>maxbal then
      stop()
    end
   
    if roundprofit > 0 then
      roundprofit = 0
    end
   
    if (!win) then
      nextbet = previousbet
    print ("LOSE")
    print(nextbet)
    end
   
    if balance<minbal then
      stop()
    end
   
    if balance>maxbal then
      stop()
    end

    if(!firstgame) then
      if(nextbet >= ProtectedProfit) and (profit > ProtectedProfit) then
        nextbet = basebet
        reset = true
      end
    end
  firstgame = false

  end
chilly2k (OP)
Legendary
*
Offline Offline

Activity: 1007
Merit: 1000


View Profile
April 29, 2016, 07:41:16 PM
 #180

I'm getting this error on my script...can't figure out where the problem is?

[string "chunk"]:32: attempt to compare number with nil


Here's the script:
Code:
  basebet = balance/500
  nextbet = basebet
  roundprofit = 0
  chance = 87.79
  maxbal=balance+0.01500000
  ProtectedProfit = .0003
  reset = false
  firstgame = true

  function dobet()

    roundprofit += currentprofit

    if (win) then
      if(profit > (ProtectedProfit*1.2)) then
        ProtectedProfit = ProtectedProfit*1.2
      end
      if(profit <= (ProtectedProfit/4)) then
        ProtectedProfit = ProtectedProfit/2
        if(ProtectedProfit < .000150) then
          ProtectedProfit = .000150
        end
      end
      if (roundprofit < 0) and (!reset) then
        nextbet = previousbet + basebet
        print ("WIN")
      print(nextbet)
      end
    else
      nextbet = basebet
      print ("WIN")
    print(nextbet)
      reset = false
    end
   
    if balance<minbal then
      stop()
    end
   
    if balance>maxbal then
      stop()
    end
   
    if roundprofit > 0 then
      roundprofit = 0
    end
   
    if (!win) then
      nextbet = previousbet
    print ("LOSE")
    print(nextbet)
    end
   
    if balance<minbal then
      stop()
    end
   
    if balance>maxbal then
      stop()
    end

    if(!firstgame) then
      if(nextbet >= ProtectedProfit) and (profit > ProtectedProfit) then
        nextbet = basebet
        reset = true
      end
    end
  firstgame = false

  end

   I believe you forgot to define minbal.    Also from the error message "[string "chunk"]:32: attempt to compare number with nil"  The 32 looks to be the 32nd non=blank line in the script.  I just noticed this, so that may or may not be the correct way to get to the failing line. 

Pages: « 1 2 3 4 5 6 7 8 [9] 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 ... 62 »
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!