buda Posted November 15, 2012 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 36 Reputation: 0 Joined: 06/21/12 Last Seen: December 19, 2012 Share Posted November 15, 2012 The Players will input a certain amount of zeny Condition: 20% chance to multiply the player's bet by 5 times. thanks to all of you Master scripters!!!! thanks for helping me all the time...... Take care guys! Quote Link to comment Share on other sites More sharing options...
Euphy Posted November 15, 2012 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted November 15, 2012 input .@i; if (.@i == 0 || .@i > Zeny) mes "That's an invalid amount."; else { mes "You've bet "+.@i+" Zeny..."; set Zeny, Zeny-.@i; sleep2 1000; if (!rand(5)) { mes "You Win!"; set Zeny, Zeny+(.@i*5); } else mes "You Lose."; } close; Somehow I expected more from a "super request"... :3 2 Quote Link to comment Share on other sites More sharing options...
nanakiwurtz Posted November 15, 2012 Group: Members Topic Count: 81 Topics Per Day: 0.02 Content Count: 1654 Reputation: 583 Joined: 08/09/12 Last Seen: January 14, 2020 Share Posted November 15, 2012 Somehow I expected more from a "super request"... :3 +1 1 Quote Link to comment Share on other sites More sharing options...
buda Posted November 15, 2012 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 36 Reputation: 0 Joined: 06/21/12 Last Seen: December 19, 2012 Author Share Posted November 15, 2012 thanks master scripter! What a Very Undestandable Script.... but i dont understand why the NPC limits the zeny for 10M ? Even i Bet for 100M, and still, 10M is the max bet? <--------------------------- Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted November 15, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted November 15, 2012 (edited) FUN XD prontera,158,177,5 script kdjfhkshf2 100,{ if ( !zeny ) { mes "you don't have any zeny left to bet <3"; close; } input .@i, 1, zeny; mes "are you sure you want to bet "+ .@i +" zeny ?"; next; if ( select ( "yes", "no" ) == 2 ) close; if ( .@i *5 + zeny > 1000000000 ) { // prevent zeny lost mes "you can't bet more than the amount of zeny you can carry"; close; } zeny -= .@i; sleep2 1000; if ( !rand(5) ) { mes "you win"; zeny = zeny + ( .@i *5 ); } else mes "you lose"; close; } some discovery 1. when I use zeny += ( .@i *5 ) if I input 1 zeny, even though I have 500 zeny, it becomes 6 no idea why I guess something wrong with script engine ... hahaha 2. I already knew this input is limited to 10000000, http://www.eathena.ws/board/index.php?showtopic=190502 also 1 of our crappy script engine 3. I tested with euphy script... I originally thought if I carry more than MAX_ZENY define in mmo.h the server should throw max_zeny parameter ... overflow zeny error but my test server didn't throw any error at all ! so euphy script is also actually working and doesn't gives any error at all so it just player's fault to bet more than the zeny they can carry wahahah ... really a fun script, not lame ! EDIT: buda post faster than I did Edited November 15, 2012 by AnnieRuru Quote Link to comment Share on other sites More sharing options...
nanakiwurtz Posted November 15, 2012 Group: Members Topic Count: 81 Topics Per Day: 0.02 Content Count: 1654 Reputation: 583 Joined: 08/09/12 Last Seen: January 14, 2020 Share Posted November 15, 2012 zeny -= .@i; sleep2 1000; if ( !rand(5) ) { mes "you win"; zeny = zeny + ( .@i *5 ); } else mes "you lose"; close; Does it mean if you both win or lose, the zeny is deducted first? For example: .@i = 1, zeny = 500 If win = (500-1)+(1*5) = 504? If lose = (500-1)=499? Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted November 15, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted November 15, 2012 yeah, the topic starter already stated it The Players will input a certain amount of zeny Condition: 20% chance to multiply the player's bet by 5 times. of course you have to put your money on the table,then the dealer only multiply your bet according to the money you've put on the table, not from the money inside your pocket actually euphy is a very great scripter too, his skill can be higher than me it just this kind of stuff has to be accumulated through years of experience because of our crappy script engine like keyworld said, sometimes its not scripter's fault, but script engine fault hahaha Quote Link to comment Share on other sites More sharing options...
nanakiwurtz Posted November 15, 2012 Group: Members Topic Count: 81 Topics Per Day: 0.02 Content Count: 1654 Reputation: 583 Joined: 08/09/12 Last Seen: January 14, 2020 Share Posted November 15, 2012 I mean, why not like this? sleep2 1000; if ( !rand(5) ) { mes "you win"; zeny = zeny + ( .@i *5 ); } else { zeny -= .@i; mes "you lose"; } close; 1 Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted November 15, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted November 15, 2012 (edited) WTF !!!! I also got tricked by the definition from the request ! http://en.wikipedia....betting_system) The strategy had the gambler double his bet after every loss, so that the first win would recover all previous losses plus win a profit equal to the original stake. The martingale strategy has been applied to roulette as well, as the probability of hitting either red or black is close to 50%. https://rathena.svn....c/blackjack.txt L_Play: mes "[Dealer]"; mes "Please place your bets..."; next; menu "2z",M_1a, "10z",M_1b, "20z",M_1c, "100z",M_1d, "Too rich for my blood....",M_End; M_1a: if(Zeny < 2) goto sL_NotEnuf; set @bet, 2; goto L_Cont0; M_1b: if(Zeny < 10) goto sL_NotEnuf; set @bet, 10; goto L_Cont0; M_1c: if(Zeny < 20) goto sL_NotEnuf; set @bet, 20; goto L_Cont0; M_1d: if(Zeny < 100) goto sL_NotEnuf; set @bet, 100; goto L_Cont0; ..... sL_Win: mes "[Dealer]"; mes "Congratulations, you've won!"; next; set Zeny, Zeny + @bet; goto L_Play; sL_Lose: mes "[Dealer]"; mes "I'm sorry but you've lost."; set Zeny, Zeny - @bet; next; goto L_Play; up your post <3 prontera,158,177,5 script kdjfhkshf2 100,{ if ( !zeny ) { mes "you don't have any zeny left to bet <3"; close; } input .@i, 1, zeny; mes "are you sure you want to bet "+ .@i +" zeny ?"; next; if ( select ( "yes", "no" ) == 2 ) close; if ( .@i *5 + zeny > 1000000000 ) { // prevent zeny lost mes "you can't bet more than the amount of zeny you can carry"; close; } if ( zeny < .@i ) mes "don't cheat me by using @mail"; else if ( !rand(1) ) { mes "you win"; zeny = zeny + ( .@i *5 ); } else { mes "you lose"; zeny -= .@i; } close; } EDIT: suddenly feel like making Roulette script ... can be fun XD but nah ... no time atm, better make battleground script EDIT2: totally forgotten about @mail again ... damn http://www.goodbonusguide.com/casino-articles/roulette-systems-destroying-the-martingale-theory-myth.html http://wizardofodds.com/gambling/betting-systems/ ... fun article can learn something new even with simple script Edited November 15, 2012 by AnnieRuru Quote Link to comment Share on other sites More sharing options...
buda Posted November 15, 2012 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 36 Reputation: 0 Joined: 06/21/12 Last Seen: December 19, 2012 Author Share Posted November 15, 2012 So master scripters, how can we exceed it into 10M ? I hope we can do it! The future is within us! WTF !!!! I also got tricked by the definition from the request ! http://en.wikipedia....betting_system) The strategy had the gambler double his bet after every loss, so that the first win would recover all previous losses plus win a profit equal to the original stake. The martingale strategy has been applied to roulette as well, as the probability of hitting either red or black is close to 50%. https://rathena.svn....c/blackjack.txt L_Play: mes "[Dealer]"; mes "Please place your bets..."; next; menu "2z",M_1a, "10z",M_1b, "20z",M_1c, "100z",M_1d, "Too rich for my blood....",M_End; M_1a: if(Zeny < 2) goto sL_NotEnuf; set @bet, 2; goto L_Cont0; M_1b: if(Zeny < 10) goto sL_NotEnuf; set @bet, 10; goto L_Cont0; M_1c: if(Zeny < 20) goto sL_NotEnuf; set @bet, 20; goto L_Cont0; M_1d: if(Zeny < 100) goto sL_NotEnuf; set @bet, 100; goto L_Cont0; ..... sL_Win: mes "[Dealer]"; mes "Congratulations, you've won!"; next; set Zeny, Zeny + @bet; goto L_Play; sL_Lose: mes "[Dealer]"; mes "I'm sorry but you've lost."; set Zeny, Zeny - @bet; next; goto L_Play; up your post <3 prontera,158,177,5 script kdjfhkshf2 100,{ if ( !zeny ) { mes "you don't have any zeny left to bet <3"; close; } input .@i, 1, zeny; mes "are you sure you want to bet "+ .@i +" zeny ?"; next; if ( select ( "yes", "no" ) == 2 ) close; if ( .@i *5 + zeny > 1000000000 ) { // prevent zeny lost mes "you can't bet more than the amount of zeny you can carry"; close; } if ( zeny < .@i ) mes "don't cheat me by using @mail"; else if ( !rand(1) ) { mes "you win"; zeny = zeny + ( .@i *5 ); } else { mes "you lose"; zeny -= .@i; } close; } EDIT: suddenly feel like making Roulette script ... can be fun XD but nah ... no time atm, better make battleground script EDIT2: totally forgotten about @mail again ... damn http://www.goodbonus...heory-myth.html http://wizardofodds....etting-systems/ ... fun article can learn something new even with simple script My nose is bleeding while reading this Quote Link to comment Share on other sites More sharing options...
Emistry Posted November 15, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted November 15, 2012 (edited) So master scripters, how can we exceed it into 10M ? you mean the input amount ? trunk/conf/script_athena.conf // Default value of the 'max' argument of the script command 'input'. // When the 'max' argument isn't provided, this value is used instead. // Defaults to INT_MAX. //input_max_value: 2147483647 input_max_value: 10000000 EDIT : btw... Condition: 20% chance to multiply the player's bet by 5 times. it should be something similar to euphy post above...or zeny = zeny + (( !rand(5) )? ( .@i * 5 ):.@i ); Edited November 15, 2012 by Emistry Quote Link to comment Share on other sites More sharing options...
buda Posted November 15, 2012 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 36 Reputation: 0 Joined: 06/21/12 Last Seen: December 19, 2012 Author Share Posted November 15, 2012 (edited) Master Euphy's Script is Super Duper Correct and it meets 101% of my expectation.... The only problem i encounter is the 10M limit. huhuhuhu,, i hope we can bypass it So master scripters, how can we exceed it into 10M ? you mean the input amount ? trunk/conf/script_athena.conf // Default value of the 'max' argument of the script command 'input'. // When the 'max' argument isn't provided, this value is used instead. // Defaults to INT_MAX. //input_max_value: 2147483647 input_max_value: 10000000 EDIT : btw... Condition: 20% chance to multiply the player's bet by 5 times. it should be something similar to euphy post above...or zeny = zeny + (( !rand(5) )? ( .@i * 5 ):.@i ); input_max_value: 10000000 so, the 10m came from this one... of i change it to input_max_value: 100000000 (100m) this will be ok? input_max_value: 100000000 (100m) done! case closed! thanks master scripters!!!!! Edited November 15, 2012 by buda Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted November 15, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted November 15, 2012 zeny = zeny + (( !rand(5) )? ( .@i * 5 ):.@i ); more like this prontera,155,177,5 script dkfjhsdfkjs 100,{ .@i = 1; while (1) { zeny = zeny + (( !rand(5) )? ( .@i * 5 ): -.@i ); // has a negative sleep2 250; } } although this works, but I don't recommend do something like this I don't believe in how rathena script engine calculating value inside compact if-else I just try this script ... my money really going up ... o.O that betting trick really prove can beat this system to gain infinite money .... in theory of course 1 Quote Link to comment Share on other sites More sharing options...
buda Posted November 15, 2012 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 36 Reputation: 0 Joined: 06/21/12 Last Seen: December 19, 2012 Author Share Posted November 15, 2012 -.@i is for what master? Quote Link to comment Share on other sites More sharing options...
nanakiwurtz Posted November 15, 2012 Group: Members Topic Count: 81 Topics Per Day: 0.02 Content Count: 1654 Reputation: 583 Joined: 08/09/12 Last Seen: January 14, 2020 Share Posted November 15, 2012 (edited) I think you'll want to do this: zeny = zeny+((!rand(5))?(.@i*-1).@i*5)); Annie's current script is turned upside down, it will make the user to have 20% chance to lose, not 20% to win.. Edited November 15, 2012 by nanakiwurtz Quote Link to comment Share on other sites More sharing options...
Peopleperson49 Posted November 16, 2012 Group: Members Topic Count: 219 Topics Per Day: 0.05 Content Count: 1181 Reputation: 141 Joined: 01/27/12 Last Seen: April 15 Share Posted November 16, 2012 (edited) Buda .@i is just a variable use to store the inputed zeny amount. Annie does anybody still use that archaic blackjack scirpt from the SVN? Peopleperson49 doc/script_command.txt Variables --------- The meat of every programming language is variables - places where you store data. In the rAthena scripting language, variable names are not case sensitive. Variables are divided into and uniquely identified by the combination of: prefix - determines the scope and extent (or lifetime) of the variable name - an identifier consisting of '_' and alphanumeric characters postfix - determines the type of the variable: integer or string Scope can be: global - global to all servers local - local to the server account - attached to the account of the character identified by RID character - attached to the character identified by RID npc - attached to the NPC scope - attached to the scope of the instance Extent can be: permanent - They still exist when the server resets. temporary - They cease to exist when the server resets. Prefix: scope and extent nothing - A permanent variable attached to the character, the default variable type. They are stored with all the account data in "save\athena.txt" in TXT versions and in the SQL versions in the `global_reg_value` table using type 3. "@" - A temporary variable attached to the character. SVN versions before 2094 revision and RC5 version will also treat 'l' as a temporary variable prefix, so beware of having variable names starting with 'l' if you want full backward compatibility. "$" - A global permanent variable. They are stored in "save\mapreg.txt" or database table `mapreg`, depending on server type. "$@" - A global temporary variable. This is important for scripts which are called with no RID attached, that is, not triggered by a specific character object. "." - A NPC variable. They exist in the NPC and disappear when the server restarts or the NPC is reloaded. Can be accessed from inside the NPC or by calling 'getvariableofnpc'. Function objects can also have .variables which are accessible from inside the function, however 'getvariableofnpc' does NOT work on function objects. ".@" - A scope variable. They are unique to the instance and scope. Each instance has it's own scope that ends when the script ends. Calling a function with callsub/callfunc starts a new scope, returning from the function ends it. When a scope ends, it's variables are converted to values ('return .@var;' returns a value, not a reference). "'" - An instance variable These are used with the instancing system, and are unique to each party's instance. "#" - A permanent local account variable. They are stored with all the account data in "save\accreg.txt" in TXT versions and in the SQL versions in the 'global_reg_value' table using type 2. "##" - A permanent global account variable stored by the login server. They are stored in "save\account.txt" and in the SQL versions in the 'global_reg_value' table, using type 1. The only difference you will note from normal # variables is when you have multiple char-servers connected to the same login server. The # variables are unique to each char-server, while the ## variables are shared by all these char-servers. Postfix: integer or string nothing - integer variable, can store positive and negative numbers, but only whole numbers (so don't expect to do any fractional math) '$' - string variable, can store text Examples: name - permanent character integer variable name$ - permanent character string variable @name - temporary character integer variable @name$ - temporary character string variable $name - permanent global integer variable $name$ - permanent global string variable $@name - temporary global integer variable $@name$ - temporary global string variable .name - NPC integer variable .name$ - NPC string variable .@name - scope integer variable .@name$ - scope string variable #name - permanent local account integer variable #name$ - permanent local account string variable ##name - permanent global account integer variable ##name$ - permanent global account string variable Edited November 16, 2012 by Peopleperson49 Quote Link to comment Share on other sites More sharing options...
Ajjwidjdneidjenw Posted November 16, 2012 Group: Members Topic Count: 15 Topics Per Day: 0.00 Content Count: 161 Reputation: 31 Joined: 12/06/11 Last Seen: December 25, 2022 Share Posted November 16, 2012 Th zeny = zeny + (( !rand(5) )? ( .@i * 5 ):.@i ); more like this prontera,155,177,5 script dkfjhsdfkjs 100,{ .@i = 1; while (1) { zeny = zeny + (( !rand(5) )? ( .@i * 5 ): -.@i ); // has a negative sleep2 250; } } although this works, but I don't recommend do something like this I don't believe in how rathena script engine calculating value inside compact if-else I just try this script ... my money really going up ... o.O that betting trick really prove can beat this system to gain infinite money .... in theory of course Is it now possible to set Varaibles without the 'set' command? Quote Link to comment Share on other sites More sharing options...
Peopleperson49 Posted November 16, 2012 Group: Members Topic Count: 219 Topics Per Day: 0.05 Content Count: 1181 Reputation: 141 Joined: 01/27/12 Last Seen: April 15 Share Posted November 16, 2012 In the first version I think it should change the "if(.@i==0||.@i>zeny)" to "if(.@i<1||.@i>zeny)". If somebody inputs a negative number there is no protection from it. Garet999 you can do it the same way as you would in src coding which allows you to not use 'set' for some things. Just as you can also increase numbers by using ++ in some cases. Most people don't code this way or even understand it, but Annie loves her style. I try to avoid it because it is easier to teach others with the more common methods. More power to Annie! Peopleperson49 Quote Link to comment Share on other sites More sharing options...
Ajjwidjdneidjenw Posted November 16, 2012 Group: Members Topic Count: 15 Topics Per Day: 0.00 Content Count: 161 Reputation: 31 Joined: 12/06/11 Last Seen: December 25, 2022 Share Posted November 16, 2012 As far as I'm aware ++ didn't work in older revisions, thus I always used +1. I was never aware you could set variables like you would set integers in the SRC. Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted November 16, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted November 16, 2012 In the first version I think it should change the "if(.@i==0||.@i>zeny)" to "if(.@i<1||.@i>zeny)". If somebody inputs a negative number there is no protection from it.by defaultinput .@i; is equal to input .@i, 0, 1000000; you can't have negative input unless you specify for a negative input beforehand input .@i, -100, 100; only this accept negative input http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=811 @garet999 that .@var++ is only support in rathena Quote Link to comment Share on other sites More sharing options...
Peopleperson49 Posted November 16, 2012 Group: Members Topic Count: 219 Topics Per Day: 0.05 Content Count: 1181 Reputation: 141 Joined: 01/27/12 Last Seen: April 15 Share Posted November 16, 2012 Good to know thanks Annie. However, now I am confused because it let me do it on my server. It errored when I won, but if I lost I recieved money from it. Peopleperson49 Quote Link to comment Share on other sites More sharing options...
buda Posted November 16, 2012 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 36 Reputation: 0 Joined: 06/21/12 Last Seen: December 19, 2012 Author Share Posted November 16, 2012 I never thought that this simple request will be this complicated. hahahahaah... morover, 100% of my script requests are solved by all of you guys!!! thanks to all of you master scripters!!! Quote Link to comment Share on other sites More sharing options...
cadz Posted November 28, 2012 Group: Members Topic Count: 83 Topics Per Day: 0.02 Content Count: 243 Reputation: 1 Joined: 08/29/12 Last Seen: August 1, 2021 Share Posted November 28, 2012 buda can you share the script to me? Quote Link to comment Share on other sites More sharing options...
Question
buda
The Players will input a certain amount of zeny
Condition: 20% chance to multiply the player's bet by 5 times.
thanks to all of you Master scripters!!!!
thanks for helping me all the time......
Take care guys!
Link to comment
Share on other sites
22 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.