Jump to content

Mumbles

Retired Staff
  • Content Count

    618
  • Joined

  • Last visited

  • Days Won

    15

Posts posted by Mumbles


  1. 1 hour ago, REKT said:

    I tried this method before but it doesn't work. if you know what i mean......
    Again,

    I want to exchange the 1 Coin it's going to be 10 .points_var$
    A. if i change 2 coins to points = 20 .points_var$
    B. if i want to change exchange my 20 points to coin is going to be 2pcs Coin

    I wrote this script many years ago in response to a request, and it doesn't look like I designed it to be reconfigurable in that direction in a user-friendly manner. Some operations needed to be flipped around for the requested effect. You can view the diff for that here: https://www.diffchecker.com/PlW5DQYU/

     

    I have uploaded an alternate version of this script that converts points to items, 10:1. You can download it here: https://github.com/datmumbles/Scripts/blob/master/util/points2item_v1.0a.txt

     

    Now you should be able to change the value of .rate and it will convert the way you wanted.

     

    I also realize @XtriC asked for this particular function many years ago, and I hadn't realized it wasn't going to do what he asked. Four years late, but this is the solution lol


  2. 6 hours ago, REKT said:

    @Mumbles another favor bro PLEASE? incase if you are not busy, i just need a small assistance on this script.
    I'm really bad at conversion.

    What i want is. Every 1 x .pod_id = 10 .points_var$ = "#CASHPOINTS";
    Vice-Versa.

    If you have 2 x .pod_id = 20 points (.point_var$)
    https://raw.githubusercontent.com/datmumbles/Scripts/master/util/points2item.txt
     

    If you want to change the rate of points per PoD, just change:

    .rate = 20;

    to your desired rate, in which case would be:

    .rate = 10;

     It is located on Line 129, under the Configuration heading.


  3. On 6/20/2020 at 5:13 AM, antonycbueno said:

    With some friend help the problem is solved...

    I just put in option diff the following text in "recommendedquest.lub" to read my file "System/recommendedquest" without the extension.

    This is actually so annoying that it works without any real explanation as to why


  4. 2 hours ago, Fred said:

    But seems not work ? I replaced the @go command on src\map\atcommand 

     

    Well...this was your first mistake. This is a script-based atcommand utility; it should be loaded as a custom .txt script. Copy the original file I provided and add its location to npc/scripts_custom.conf; doing this will override the src-based atcommand when your server initializes.

     

     

    2 hours ago, Fred said:

    I created the code for glast_01

     

     

            } else if (alias("36", "glast")) {
                go("glast", 370, 304, 0, 0, .cost);

     

            } else {
                message strcharinfo(0), "36: Glast";
                message strcharinfo(0), "@go failed.";
            }
            
            end;

     

     

     

    I think you might have misunderstood the way the script functions. Aliases included in the alias() function serve to allow a player to type multiple different variants of a phrase to arrive at the same location.

     

    An example in your case:

    alias("36", "glast", "gh")

    ...would allow the player to type:

    @go "36"
    @go "glast"
    @go "gh"

    ...and still arrive at the same map and coordinates that you set for that alias.

     

    You seem to have added the alias name in the go() function instead of the map name. The correct way to add an @go point for glast_01 would be to include the map_name in the go() function. Try this:

    go("glast_01", 370, 304, 0, 0, .cost);

     

     

    Hope this resolves your issue. Please note that I wrote this script-based atcommand utility several years ago; I have not kept up with Hercules's progress, so this information may be entirely deprecated. However, if you are running a version of Hercules where this script was still compatible, my corrections should suffice.

     

    Good luck!


  5. 5 hours ago, Ridley said:

    identifyall was just recently added https://github.com/HerculesWS/Hercules/pull/2487

    identifyall was solely added as an atcommand, wasn't it?

    I made this as a script-command based on reiterations of identify() so users could make an inline function in their quest, event, or utility scripts.

    The benefits are trivial and would mostly suit low-rate servers with a low zeny pool, but they're beneficial nonetheless. ¯\_(ツ)_/¯
     

    This script-command version of identifyall() provides the following:

    • A return value for the number of items identified
      • Enables the possibility of using the amount of items identified to create individual cost or bulk pricing
        • i.e. 10 items identified for 400 Z (base cost for 10x items identified @ 40 Z each)
        • i.e. 23 items identified for 805 Z (bulk cost for 23x items identied @ 35 Z each, when identifying 20 or more at once)
      • Allows for the number of items identified (and the maths on cost) to be displayed to the user, for informational purposes
      • Eliminates redundant scripting by alternatively using atcommand "@identifyall"; in a script and still needing to gather the number of items identified
    • Allows for use of identifyall as a script-command rather than an atcommand, particularly under circumstances when using atcommands in general are restricted, limited, or undesirable
    • With some modification, this can be changed into a global function so it can be used across multiple scripts

    With a little imagination and creativity,  identifyall as a script-command can be used for interfacing with various utilities, zeny sinks, and other features. Like I said -- this little script command would find its niche mostly in low-rate servers, but it'll be here if it's needed.


  6. Function: identifyall()

    Quick function to complement commit #24c4d53.
     

    Full version:
    Identifies all unidentified items in user's inventory and returns the number of items identified.

    Quick-use version:
    Identifies all unidentified items in user's inventory without returning any additional values.

    Usage:

    Spoiler
    11 minutes ago, Mumbles said:

    This script-command version of identifyall() provides the following:

    • A return value for the number of items identified
      • Enables the possibility of using the amount of items identified to create individual cost or bulk pricing
        • i.e. 10 items identified for 400 Z (base cost for 10x items identified @ 40 Z each)
        • i.e. 23 items identified for 805 Z (bulk cost for 23x items identied @ 35 Z each, when identifying 20 or more at once)
      • Allows for the number of items identified (and the maths on cost) to be displayed to the user, for informational purposes
      • Eliminates redundant scripting by alternatively using atcommand "@identifyall"; in a script and still needing to gather the number of items identified
    • Allows for use of identifyall as a script-command rather than an atcommand, particularly under circumstances when using atcommands in general are restricted, limited, or undesirable
    • With some modification, this can be changed into a global function so it can be used across multiple scripts

    With a little imagination and creativity,  identifyall as a script-command can be used for interfacing with various utilities, zeny sinks, and other features. Like I said -- this little script command would find its niche mostly in low-rate servers, but it'll be here if it's needed.

    Download:
    identifyall.txt

    Mirror:
    https://upaste.me/f75351070d03c790e

     


  7. 19 minutes ago, Yoh Asakura said:

    Did she go crying to you to post in here?

    I am the one who actually wasted my time trying to talk with her to get the prize and in the end got nothing.

    I have nothing more to say, I did not disrespect her, just take a look at the pics.

    If anyone came crying, it'd appear to be you. To answer your question, though -- no; I just had the misfortune of coming across your cancerous post on the front page.

    Poor you -- you wasted a whole few moments of your pathetic life waiting for something that was free; of no cost to you whatsoever. And for all your efforts, you didn't get it. Geez. How sad.

    I've collaborated with Daifuku in the past, and I've admittedly pushed her limits in order to meet a deadline -- but never once did I disrespect her or cause her to feel like abandoning a project was a better solution. You've got to be a pretty foul human being to make someone as nice as her pass on you.

    If you want a prize, take a life lesson instead as a consolation: Treat people with dignity and respect, and maybe next time you won't be such a loser.


  8. People get busy; we all have lives outside of these boards (believe it or not), and it should be expected that our real-world responsibilities and obligations take precedence over our business online.

    You obviously had your own priorities (in this case, your health), and were unable to contact Daifuku in a timely manner to redeem your prize. Fortunately, she was still willing to work with you instead of choosing a runner-up. Considering that she had been willing to be flexible with you a month after the fact, you should have been similarly acquiescent when she had contacted you a few days after the date she said she'd respond by — but instead, you harassed her to the point that she ultimately rescinded her giveaway.

    I haven't posted here in years, but seeing this post was triggering. To say that Hercules deserves better is ridiculous and insulting. Hercules holds a high standard for staff members; Daifuku wouldn't have earned her position if she wasn't of good moral character, untalented, or undeserving. If anything, Daifuku deserves better than to be treated like some sort of servant.

    Did you lose anything of value by entering her giveaway? Did you lose sleep while you were waiting for a response? I'd hope not. Maybe evaluate how you communicate with people when they are doing something out of their own free will and generosity — especially when it's at no cost to you.


  9. Here's an updated version without global variables and a simplified flow:

     

    -	script	vaporize	-1,{
    	 
    	OnPCLoginEvent:
    		// Set AFK check on login
    		addtimer 60000, strnpcinfo(0) + "::On1min";
    		end;
    	 
    	On1min:
    		// Check if player has Homunculus and if AFK longer than allowed
    		if(gethominfo(2) != "null" && checkidle() >= .vaporize) {
    			atcommand "@useskill 244 1 " + strcharinfo(0);
    			dispbottom "You are not allowed to farm with Homunculus while AFK.";
    		}
    		
    		// Reset AFK check
    		addtimer 60000, strnpcinfo(0) + "::On1min";
    		end;
    		
    	OnInit:
    		// Time (in seconds) before vaporizing
    		.vaporize = 120;
    		end;
    }
    
    

  10. I want to know if I must remove @go command from src or this will replace the current functionality that @go does in src...

     

    This code might be deprecated. If it does still work, it should overwrite the existing functionality of @go. When this was written, you did not need to make any src changes, as bindatcmd binded @go to the specified label within the script.


  11. In previous versions (not sure if still possible), you could pre-load a script in npc/scripts_custom.conf and it could potentially affect the next script in line if it wasn't closed properly.

     

    Example:

    npc: npc/custom/npc1.txtnpc: npc/custom/npc2.txt

     

    If npc/custom/npc1.txt was missing a right curly at the end of the file, it would still load, but the next file in line (in this example, npc/custom/npc2.txt) would throw an error at line 1.

     

     

    Just throwing that idea out there; it very well might not be the solution to your problem, but there's nothing wrong with making sure all of your custom scripts have no errors. d:


  12. Did you read the second part? o.O



     

    If you were randomizing MVP summons, however, you could do something like this:

    -	script	summon_mvp	-1,{	OnInit:        // Set MVP IDs        setarray .mvp_id[0], BAPHOMET, GOLDEN_BUG, KNIGHT_OF_WINDSTORM, GARM, ORK_HERO;            OnSetID:        // Randomly select MVP to summon        .summon_id = .mvp_id[rand(getarraysize(.mvp_id))];        		// Summon Random MVP		monster "prt_fild08", 0, 0, getmonsterinfo(.summon_id, MOB_NAME), .summon_id, 1, strnpcinfo(0) +"::OnKilledMVP";		end;			OnKilledMVP:		// Announce MVP death		announce strcharinfo(0) +" has killed "+ getmonsterinfo(.summon_id, MOB_NAME) +"!", bc_all;				// Respawn new MVP		donpcevent strnpcinfo(3) +"::OnSetID";		end; }

  13. You're over-thinking your implementation.
     
    On a smaller scale, you could write something like:

    -	script	summon_mvp	-1,{	OnInit:		monster "prt_fild08", 0, 0, "Baphomet", BAPHOMET, 1, strnpcinfo(0) +"::OnKilledBapho";		end;			OnKilledBapho:		announce strcharinfo(0) +" has killed "+ getmonsterinfo(BAPHOMET, MOB_NAME) +"!", bc_all;		end;}

     
    ...but since you've already specified a very particular event (OnKilledBapho) for your Baphomet mob, you don't really need to pull the RID to display the name, nor do you even need to use getmonsterinfo(). Since you told the script to run OnKilledBapho when the event Baphomet is killed, you could just simply write your announcement like this:

    		announce strcharinfo(0) +" has killed Baphomet!", bc_all;


    If you were randomizing MVP summons, however, you could do something like this:

    -	script	summon_mvp	-1,{	OnInit:        // Set MVP IDs        setarray .mvp_id[0], BAPHOMET, GOLDEN_BUG, KNIGHT_OF_WINDSTORM, GARM, ORK_HERO;            OnSetID:        // Randomly select MVP to summon        .summon_id = .mvp_id[rand(getarraysize(.mvp_id))];        		// Summon Random MVP		monster "prt_fild08", 0, 0, getmonsterinfo(.summon_id, MOB_NAME), .summon_id, 1, strnpcinfo(0) +"::OnKilledMVP";		end;			OnKilledMVP:		// Announce MVP death		announce strcharinfo(0) +" has killed "+ getmonsterinfo(.summon_id, MOB_NAME) +"!", bc_all;				// Respawn new MVP		donpcevent strnpcinfo(3) +"::OnSetID";		end; }

  14. Actually this nowarpto mapflag is designed for @warp command and not @go since you only have limited maps available for @go and you can simply remove the map if you don't want to allow people from warping to that town. 

     

    Edit:

     

    I have another problem though, the script does not bypass the nowarp mapflag even if your GM level is high.

     

    So the documentation for nowarpto is correct, then; lost track of what the original issue was for a sec lol.

     

     

    In your last reply, you mentioned replacing mf_nowarp with mf_nowarpto:

    } else if (getgroupid() < getarg(4) || getmapflag(getarg(0), mf_nowarp)) {

     

    However, the intent of this line is to prevent warping if the player's Group ID isn't high enough OR if the destination has a nowarp flag, regardless of Group ID. You can bypass this for GMs by changing the expression a little (I'm sure there's a prettier way to do it, but I'm not feeling up to it):

    } else if (getgroupid() < getarg(4) || getmapflag(getarg(0), mf_nowarp) && getgroupid() < getarg(4)) {

     

     

    In regard to your original inquiry, the behaviour of nowarp is to prevent the use of @go to a destination; to prevent the use of @go from a map flagged with nowarp (despite this not being the intent of the nowarp flag), you can still prevent warping by adding an expression similar to my original suggestion:

    		} else if (getmapflag(strcharinfo(3), mf_nowarp)) {			message strcharinfo(0), "You are not authorised to warp from this map.";

    If you would like to prevent warping from specific maps, I would recommend moving forward with the filter/blacklist route — hell, you could even prevent both nowarp-flagged and specific maps from being warped to if you wanted to.


  15. Got it, thank you very much Mumbles! ~

     

    Can you please confirm (via in-game test) that nowarpto prevents this version of @go from warping to a map flagged with nowarpto, and that nowarp prevents warping from a map flagged with nowarp?

     

    I am unable to test any in-game behaviours at this time.


  16.  

    Changes:

    [*]replaced mf_nowarp from line 72 to mf_nowarpto since that's most likely how it should work

    [*]added getmapxy script to get current location at line 60

    [*]added new script from line 64 that will check for current location if it has mf_nowarp thus preventing the use of @go.

    You could probably do without getmapxy() since the script is attached to a player when run; strcharinfo(3) will return the attached player's map name. I'd say you were correct in changing mf_nowarp to mf_nowarpto, should the function of nowarpto be that players cannot warp to the map (duh; though sometimes the documentation isn't tell-all).

     

    Someone should really update the documentation for both mapflags, as they are either lacking in information or documented incorrectly. /swt


  17. Hi Mumbles, unfortunately this didn't solve the problem. I was still able to use the @go command even if my current map has a mapflag 'nowarp'. I think the problem is with the argument, it gets the value which is the one set for each @go towns. It doesn't read the mapflag of your current map location.

    Hi Kong,

     

    Per mf_nowarp's documentation (see nowarp.txt), mf_nowarp prevents the use of @go to a map, not from it. There is currently no mapflag (that I'm aware of) that prevents warping from the map, but you can circumvent this by either adding your own blacklist/filter of disabled maps. This is an example of a blacklist injection (though I wouldn't recommend punching this into this script exactly as it is written):

     

    setarray .@blacklist$[0], "payon", "prontera", "izlude";for (.@i = 0; .@i < getarraysize(.@blacklist$); .@i++) {	if (strcharinfo(3) == .@blacklist$[.@i])) {		message strcharinfo(0), "You may not warp from this map.";		end;	}}

  18. Hi Mumbles, I'm having a small problem with the nowarp mapflag. The command is still usable even if the map is set with a 'nowarp' mapflag.

     

    Hi Kong,

     

    Thanks for the feedback. I'll push an update when I get back to my desk; for now, you can add this block of code at line 62 to accommodate your needs:

    		} else if (getmapflag(getarg(0), mf_nowarp)) {			message strcharinfo(0), "You are not authorised to warp to this map.";

  19.  

    [Debug]: Source (NPC): Variant Mineral#10 at pay_dun00 (86,139)[Warning]: script:get_val: cannot access player variable 'Emveretarcon', defaulting to 0[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: setarray (9 parameters):[Debug]: Data: variable name='.mineral' index=0[Debug]: Data: number value=0[Debug]: Data: number value=5[Debug]: Data: number value=0[Debug]: Data: number value=3[Debug]: Data: variable name='Oridecon'[Debug]: Data: number value=1[Debug]: Data: variable name='Elunium'[Debug]: Data: number value=1[Debug]: Source (NPC): Variant Mineral#10 at pay_dun00 (86,139)[Warning]: script:get_val: cannot access player variable 'Oridecon', defaultingto 0[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: setarray (9 parameters):[Debug]: Data: variable name='.mineral' index=0[Debug]: Data: number value=0[Debug]: Data: number value=5[Debug]: Data: number value=0[Debug]: Data: number value=3[Debug]: Data: number value=0[Debug]: Data: number value=1[Debug]: Data: variable name='Elunium'[Debug]: Data: number value=1[Debug]: Source (NPC): Variant Mineral#10 at pay_dun00 (86,139)[Warning]: script:get_val: cannot access player variable 'Elunium', defaulting to 0[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: setarray (9 parameters):[Debug]: Data: variable name='.mineral' index=0[Debug]: Data: variable name='Phracon'[Debug]: Data: number value=5[Debug]: Data: variable name='Emveretarcon'[Debug]: Data: number value=3[Debug]: Data: variable name='Oridecon'[Debug]: Data: number value=1[Debug]: Data: variable name='Elunium'[Debug]: Data: number value=1[Debug]: Source (NPC): Variant Mineral#20 at pay_dun00 (35,54)[Warning]: script:get_val: cannot access player variable 'Phracon', defaulting to 0[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: setarray (9 parameters):[Debug]: Data: variable name='.mineral' index=0[Debug]: Data: number value=0[Debug]: Data: number value=5[Debug]: Data: variable name='Emveretarcon'[Debug]: Data: number value=3[Debug]: Data: variable name='Oridecon'[Debug]: Data: number value=1[Debug]: Data: variable name='Elunium'[Debug]: Data: number value=1[Debug]: Source (NPC): Variant Mineral#20 at pay_dun00 (35,54)[Warning]: script:get_val: cannot access player variable 'Emveretarcon', defaulting to 0[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: setarray (9 parameters):[Debug]: Data: variable name='.mineral' index=0[Debug]: Data: number value=0[Debug]: Data: number value=5[Debug]: Data: number value=0[Debug]: Data: number value=3[Debug]: Data: variable name='Oridecon'[Debug]: Data: number value=1[Debug]: Data: variable name='Elunium'[Debug]: Data: number value=1[Debug]: Source (NPC): Variant Mineral#20 at pay_dun00 (35,54)[Warning]: script:get_val: cannot access player variable 'Oridecon', defaultingto 0[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: setarray (9 parameters):[Debug]: Data: variable name='.mineral' index=0[Debug]: Data: number value=0[Debug]: Data: number value=5[Debug]: Data: number value=0[Debug]: Data: number value=3[Debug]: Data: number value=0[Debug]: Data: number value=1[Debug]: Data: variable name='Elunium'[Debug]: Data: number value=1[Debug]: Source (NPC): Variant Mineral#20 at pay_dun00 (35,54)[Warning]: script:get_val: cannot access player variable 'Elunium', defaulting to 0

    I got errors from that scripts..?

     

    This will not work with *Athena emulators until they add compatibility for item constants (in place of IDs); this script is optimised for Hercules emulators only.1

     

     

    1If you are using Hercules, please update your emulator.


  20. pls don't teach them to use "menu" =P

     

    ref: https://github.com/HerculesWS/Hercules/pull/374

     

    This might be problematic when using menu to manipulate array indexes D:

     

    Example:

    	mes .npc_name$;	mes "Hello there, mighty warrior!";	mes "Which arena would you like to test your strength in?";	next;		// Build list of arena names	for (.@i = 0; .@i < getarraysize(.arena_data$); .@i += 4) {		.@arena_name$[.@j++] = .arena_data$[.@i];		.@mode$[.@k++] = .arena_data$[.@i] +" ["+ getmapusers(.arena_data$[.@i + 1]) +"]";	}		// Select desired arena	menu implode(.@mode$, ":"), -;	mes .npc_name$;	.@key = @menu - 1;	// Hercules	//.@key = @menu - 2;		// rAmod	.@index = .@key * 4;		// Determine map name	.@map_name$ = .arena_data$[.@index + 1];		// Determine Base Level requirement	.@base_req = atoi(.arena_data$[.@index + 2]);		// Determine room limit	.@room_limit = atoi(.arena_data$[.@index + 3]);

     

     

    *I'm also extremely rusty on scripting so maybe there's a better method by now lul

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.