Why is this url response script not working at all.

Users who are viewing this thread

Xaphan

Banned
I am making new scripts for Oasis because "inserts unnecessary story about them sort of being ripped off by renting scripts".

I am their tech and i'm doing this for free for them.  Anyway.  People are sick of the low HP at spawn trying to get this sorted for them, along with cutting current monthly server expenses.

To me the response looks fine and should be in compliance with the name server, but the responses are not firing or being received.  I am done with the system just need to figure out why the response won't work. 

integer and string counts are correct for filtering. 

Nothing is working, name server is not having conflict or even working, perms are not being restricted.

Anyone know what is wrong? It must be something simple.

Code:
("game_receive_url_response", # called by the game when a response is received from a web server, if used
   [(store_script_param, ":integer_count", 1),
    (store_script_param, ":string_count", 2),

    (assign, "$g_name_server_enabled", 1),
            (try_begin), #spawn|player|********|****|*****|****|cheese|9099909909090999909090909|123|133733|333|7777|1|2|3|4|13|5|6|7|8|14|9|10|11|12|44|33|15|
			(eq, ":integer_count", 22),
			(eq, ":string_count", 7),
              (assign, ":gold", reg3),
			  (assign, ":player_id", reg1),
			  (assign, ":unique_id", reg2),
			  (assign, ":head_item_id", reg5),
			  (assign, ":body_item_id", reg6),
			  (assign, ":gloves_item_id", reg7),
			  (assign, ":foot_item_id", reg8),
			  (assign, ":horse_id", reg9),
			  (assign, ":item_1_id", reg10),
			  (assign, ":item_2_id", reg11),
			  (assign, ":item_3_id", reg12),
			  (assign, ":item_4_id", reg13),
			  (assign, ":troop_id", reg14),
			  (assign, ":coordinate_x", reg15),
			  (assign, ":coordinate_y", reg16),
			  (assign, ":coordinate_z", reg17),
			  (assign, ":deadleave", reg18),
			  (assign, ":hp", reg19),
			  (assign, ":food_amount", reg20),
			  (assign, ":faction_id", reg21),
           
              (player_is_active, ":player_id"),
              (player_get_unique_id, ":uid", ":player_id"),
             
              (eq, ":unique_id", ":uid"),
              (str_store_player_username, s5, ":player_id"),
		      (str_store_string, s1, "@Loading character data..."), 	 
		      (str_store_string, s2, "@Welcome {s5} to Nemesis! Your GUID is {reg2}."), 
			  (str_store_string, s3, "@Your PIN is {s0} Do not share PIN!"), 
		      (str_store_string, s4, "@You currently have {reg4} gold on the bank."), 
			  (str_store_string, s5, "@Visit our website at www.pw-nemesis.com"), 
		      (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s1),
         
		      (call_script, "script_player_adjust_gold", ":player_id", ":gold", 1),	
 		 
		      (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),		
              (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s3),
			  (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s4),
			  (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s5),

			  (eq, ":deadleave", 0),
			  (try_begin),
			  (player_get_agent_id, ":agent_id", ":player_id"),
		      (agent_is_active, ":agent_id"),
              (agent_is_alive, ":agent_id"),
			  (call_script, "script_change_faction", ":player_id", ":faction_id", change_faction_type_respawn),
			  (player_set_troop_id, ":player_id", ":troop_id"),
			  (agent_set_hit_points, ":agent_id", ":hp", 1),
              (call_script, "script_cf_change_armour", ":agent_id", ":head_item_id"),
			  (call_script, "script_cf_change_armour", ":agent_id", ":body_item_id"),
			  (call_script, "script_cf_change_armour", ":agent_id", ":gloves_item_id"),
			  (call_script, "script_cf_change_armour", ":agent_id", ":foot_item_id"),
			  (gt, ":coordinate_x", 1),
			  (init_position, pos48),
              (position_set_x, pos48, ":coordinate_x"),
              (position_set_y, pos48, ":coordinate_y"),
              (position_set_z, pos48, ":coordinate_z"),
              (agent_set_position, ":agent_id", pos48),
			  (try_begin),
			  (gt, ":item_1_id", 0),
			  (agent_equip_item, ":agent_id", ":item_1_id"),
              (gt, ":item_2_id", 0),
		   	  (agent_equip_item, ":agent_id", ":item_2_id"),
              (gt, ":item_3_id", 0),
		  	  (agent_equip_item, ":agent_id", ":item_3_id"),
		      (gt, ":item_4_id", 0),
			  (agent_equip_item, ":agent_id", ":item_4_id"),
			  (try_end),
			  (try_begin),
			  (gt, ":horse_id", 200),
		      (lt, ":horse_id", 800),	
         	  (player_get_agent_id, ":player_agent_id", ":player_id"),
			  (agent_is_active, ":player_agent_id"),
		      (agent_is_alive, ":player_agent_id"),
			  (agent_get_position, pos1, ":player_agent_id"),
			  (position_move_x, pos1, 50),
			  (position_set_z_to_ground_level, pos1),
		      (set_spawn_position, pos1),
			  (spawn_horse, ":horse_id"),	
			  (try_end),
			  (try_end),

			  (else_try),
			  (eq, ":deadleave", 1),
			  #deadleaved
			  (try_begin),
			  (send_message_to_url, "@http://naoasisgate.avalon-gaming.com/removedeadleave.php?uniqueid={reg2}"),
			  (call_script, "script_player_add_default_troop_items", ":player_id", ":troop_id"),
              (call_script, "script_player_add_default_troop_armor", ":player_id", ":troop_id"),
              (call_script, "script_player_add_spawn_items", ":player_id", 0),
			  (try_end),
            (try_end),   
		(else_try),	
            (try_begin), #deposit|gold|from|********|bank|*****|9099909909090999909090909|1337|133733|333|17777|13333333|
			(eq, ":integer_count", 6),
			(eq, ":string_count", 6),
		      (assign, ":gold", reg3),
		      (assign, ":bank", reg4),
			  (assign, ":limit", reg5),
			  (player_is_active, ":player_id"),  
			  (str_store_player_username, s3, ":player_id"),  
              (player_get_gold, ":gold_value", ":player_id"),
              (gt, ":bank", ":limit"),
			  (str_store_string, s2, "@[!] Bank Limit Reached [!]"),
			  (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),	
			  (else_try),
		      (player_is_active, ":player_id"),  
			  (str_store_player_username, s3, ":player_id"),  
              (player_get_gold, ":gold_value", ":player_id"),
              (ge, ":gold_value", 5000),	
              (lt, ":bank", ":limit"),			  
	          (call_script, "script_player_adjust_gold", ":player_id", 5000, -1),		  
		      (store_add, ":plus", ":bank", 5000), 
		      (assign, reg19, ":plus"),
		      (str_store_string, s2, "@Depositing 5000, {reg19} gold in account"), 
		      (send_message_to_url, "@http://naoasisgate.avalon-gaming.com/deposit.php?uniqueid={reg2}&localid=&{reg1}&username={s3}&bank=5000&deposit=5000"), 
              (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),	
			  (else_try), 
	      	  (eq, ":gold_value", 0),
              (str_store_string, s2, "@You dont have any money to deposit"), 
              (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),	
		      (else_try),
	          (lt, ":gold_value", 5000),
              (lt, ":bank", ":limit"),			  
			  (player_get_gold, reg21, ":player_id"),
		      (store_add, ":plus", ":bank", ":gold_value"), 		     			  
		      (call_script, "script_player_adjust_gold", ":player_id", ":gold_value", -1),
			  (send_message_to_url, "@http://naoasisgate.avalon-gaming.com/deposit.php?uniqueid={reg2}&localid=&{reg1}&username={s3}&bank={reg21}&deposit=5000"),  
              (assign, reg20, ":plus"),
		      (str_store_string, s2, "@Depositing {reg21}, {reg20} gold in account"), 
              (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),		
            (try_end),
        (else_try),
		    (try_begin), #withdraw|gold|****|bank|9099909909090999909090909|1337|133733|333|17777|13333333|
			(eq, ":integer_count", 6),
			(eq, ":string_count", 4),
		      (assign, ":bank", reg4),
		      (player_is_active, ":player_id"),
		      (str_store_player_username, s3, ":player_id"), 
              (player_get_unique_id, ":uid", ":player_id"),
              (eq, ":unique_id", ":uid"),
		      (eq, ":bank", 0),
       	      (str_store_string, s2, "@You do not have enough money in your account"),			   
              (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),
		      (else_try),
		      (ge, ":bank", 5000),		
		      (send_message_to_url, "@http://naoasisgate.avalon-gaming.com/withdraw.php?uniqueid={reg2}&localid=&{reg1}&username={s3}&bank=5000"),	
		      (store_sub, ":min", ":bank", 5000), 
		      (assign, reg5, ":min"),
              (str_store_string, s2, "@Withdrawing 5000, {reg5} gold in account"),				
              (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),			
		      (call_script, "script_player_adjust_gold", ":player_id", 5000, 1),			
	      	  (else_try),
		      (lt, ":bank", 5000),	 
	          (player_is_active, ":player_id"),
              (player_get_unique_id, ":uid", ":player_id"),
              (eq, ":unique_id", ":uid"),  		  
              (send_message_to_url, "@http://naoasisgate.avalon-gaming.com/withdraw.php?uniqueid={reg2}&localid=&{reg1}&username={s3}&bank={reg4}"),  	
		      (str_store_string, s1, "@Withdrawing {reg4}, 0 gold in account"),   		  
	          (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s1),	
		      (call_script, "script_player_adjust_gold", ":player_id", ":bank", 1),			
		    (try_end), 		
        (else_try),
		    (try_begin),
			(eq, ":integer_count", ),
			(eq, ":string_count", ),
			  (assign, ":troop_id", reg14),
			  (player_is_active, ":player_id"),
			  (player_set_troop_id, ":player_id", ":troop_id"),
    (try_end),	
	(else_try),
      (ge, ":integer_count", 1),
      (assign, ":return_code", reg0),
      (try_begin), # negative return codes are internal or configuration errors, not requiring action
        (lt, ":return_code", 0),
        (server_add_message_to_log, "str_name_server_error_code_reg0"),
      (else_try), # return code 0 is success, don't kick the player
        (eq, ":return_code", 0),
        (this_or_next|lt, ":integer_count", 4), # admin permissions not received
        (eq, reg3, -1), # admin permissions not set
      (else_try),
        (ge, ":integer_count", 3),
        (ge, ":string_count", 1),
        (assign, ":player_id", reg1),
        (assign, ":unique_id", reg2),
        (player_is_active, ":player_id"),
        (player_get_unique_id, ":player_unique_id", ":player_id"),
        (eq, ":player_unique_id", ":unique_id"),
        (try_begin), # positive return codes are for rejecting the player
          (gt, ":return_code", 0),
          (try_begin),
            (eq, ":return_code", 4),
            (assign, ":rejection_string_id", "str_kicked_not_registered"),
          (else_try),
            (eq, ":return_code", 3),
            (assign, ":rejection_string_id", "str_kicked_using_invalid_name"),
          (else_try),
            (eq, ":return_code", 2),
            (assign, ":rejection_string_id", "str_kicked_using_other_clan_tag"),
          (else_try),
            (assign, ":rejection_string_id", "str_kicked_using_other_players_name"),
          (try_end),
          (multiplayer_send_2_int_to_player, ":player_id", server_event_preset_message, ":rejection_string_id", preset_message_error|preset_message_log),
          (store_mission_timer_a, ":time"), # kick the player after a short delay to try ensure they see the rejection message
          (val_add, ":time", name_server_kick_delay_interval),
          (player_set_slot, ":player_id", slot_player_kick_at_time, ":time"),
          (str_store_string, s10, ":rejection_string_id"),
          (server_add_message_to_log, "str_name_server_log_s10"),
        (try_end),
        (try_begin), # admin permissions were received
          (ge, ":integer_count", 4),
          (player_is_admin, ":player_id"),
          (assign, ":admin_permissions", reg3),
          (val_max, ":admin_permissions", 0),
          (call_script, "script_player_set_admin_permissions", ":player_id", ":admin_permissions"),
          (multiplayer_send_int_to_player, ":player_id", server_event_admin_set_permissions, ":admin_permissions"),
		  (eq, ":admin_permissions", 0), #passleak
          (player_set_is_admin, ":player_id", 0), #passleak
          (kick_player, ":player_id"), #passleak
        (try_end),
      (else_try),
        (server_add_message_to_log, "str_name_server_invalid_response"),
      (try_end),
    (try_end),
    ]),
 
I have worked with and still working with an old variation of the Oasis system. On one of the builds I was confronted with the same problem. My solution was to just change what the php saved the health at so when player loaded in, they would always have 100 health. Though I think some classes require more or less health, you can always set the health to 200 and it will auto fill to the max limit in the engine.
 
As Vornne has explained several times already, use a return ID selecting the block of code associated to your action instead of using STRINGS & INTEGERS as selecting pattern. You'll see you would have a lot less of those kind of issues.
 
Return code missing? At all theres not really a "ordered" structure in this receive_url code. I suggest you rewrite it like I did.
 
Ra'Jiska said:
As Vornne has explained several times already, use a return ID selecting the block of code associated to your action instead of using STRINGS & INTEGERS as selecting pattern. You'll see you would have a lot less of those kind of issues.

and as I tried to explain using a return code ****s up the name server.

The first int would have to be something useless that is too big for the name server to bother with, followed by the event, and just for safety the first returns would need to be useless strings.

Using a simple event of any number such as 31 or anything, is what the name server looks for resulting in it bugging out. 

That is why the first int for every response is |9099909909090999909090909|, it is an attempt to get the name server to leave it alone. 
 
domipoppe said:
Return code missing? At all theres not really a "ordered" structure in this receive_url code. I suggest you rewrite it like I did.

The string int method will work fine,  i'm sure the issue is simple, but i'm not sure what it is.
The fact that the name server is not functioning either means there is something wrong with the flow of the code.
'
I assume the problem is in the opening.

Code:
("game_receive_url_response", # called by the game when a response is received from a web server, if used
   [(store_script_param, ":integer_count", 1),
    (store_script_param, ":string_count", 2),

    (assign, "$g_name_server_enabled", 1),
            (try_begin), #spawn|player|********|****|*****|****|cheese|9099909909090999909090909|123|133733|333|7777|1|2|3|4|13|5|6|7|8|14|9|10|11|12|44|33|15|
			(eq, ":integer_count", 22),
			(eq, ":string_count", 7),
              (assign, ":gold", reg3),

I have one try begin when i need two, one to start this first operation, and one to keep it open for the rest of the operation's else trys.

Though i'm not sure how to approach it. 

I will take another look at your receive code illuminati
 
(assign, "$g_name_server_enabled", 1),
This you should do at the trigger "after_mission_start_setup" cause it could be that your name server is just not enabled.

Also implent display_message or server_add_message_to_log in your script to see where it stops or where it isn't even going to.
 
I tried many different things to fix it, my debug shows the player spawning is firing, but not completing. 

When it comes to the response script, my issue is with formatting it correctly.

I just need help making sure the format is done right so I can get oasis set up with new features. 

PW kind of needs some tlc at the moment, i'm just playing the role of technician, but i'm here to help whenever. 

I cannot go off of your response code illuminati because it is done strange.  I also changed the filtering to return codes instead of string int, it gives me message when i join you have no money to deposit. 

So like I said, my formatting is the issue, and no matter what I try, I am still pretty new and have always had issues with adding responses to PW. 

In my own mod, I have zero issues with return, it is just vornnes name server does not play nice and you have to work around it very carefully. 
 
I'm hoping maybe vornne can take a look, and see if I formatted the code correctly such as try begins and try ends in the right spots to create a client response script.  Something is ****ed up.

My latest attempt from today

Code:
("game_receive_url_response", # called by the game when a response is received from a web server, if used
   [(store_script_param, ":integer_count", 1),
    (store_script_param, ":string_count", 2),
    (assign, "$g_name_server_enabled", 1),
    (try_begin),
        (eq, ":integer_count", 0),
        (eq, ":string_count", 1),
        (display_message, s0),#error will display in console window
    (else_try),
        (gt, ":integer_count", 0),#just in case
        (assign, ":event", reg0),
        (display_message, "@{reg0}"),
    (try_begin),
        (eq, ":event", -1),#could not connect to mysql server
        (display_message, "@Could not connect to the database!"),
        (else_try),
        (assign, ":player_id", reg1),
        (assign, ":unique_id", reg2),
         
        (eq, ":event", 1),#player spawning
    (try_begin), #9099909909090999909090909|123|133733|333|7777|1|2|3|4|13|5|6|7|8|14|9|10|11|12|44|33|15|
        (eq, ":event", 9099909909090999909090909),
	(server_add_message_to_log,"@debug player spawning started"),
        (assign, ":gold", reg3),
        (assign, ":player_id", reg1),
	(assign, ":unique_id", reg2),
	(assign, ":head_item_id", reg5),
	(assign, ":body_item_id", reg6),
	(assign, ":gloves_item_id", reg7),
	(assign, ":foot_item_id", reg8),
	(assign, ":horse_id", reg9),
	(assign, ":item_1_id", reg10),
	(assign, ":item_2_id", reg11),
	(assign, ":item_3_id", reg12),
	(assign, ":item_4_id", reg13),
	(assign, ":troop_id", reg14),
        (assign, ":coordinate_x", reg15),
	(assign, ":coordinate_y", reg16),
	(assign, ":coordinate_z", reg17),
	(assign, ":deadleave", reg18),
	(assign, ":hp", reg19),
	(assign, ":food_amount", reg20),
	(assign, ":faction_id", reg21),
           
        (player_is_active, ":player_id"),
        (player_get_unique_id, ":uid", ":player_id"),
             
        (eq, ":unique_id", ":uid"),
        (str_store_player_username, s5, ":player_id"),
        (str_store_string, s1, "@Loading character data..."), 	 
        (str_store_string, s2, "@Welcome {s5} to Nemesis! Your GUID is {reg2}."), 
	(str_store_string, s3, "@Your PIN is {s0} Do not share PIN!"), 
	(str_store_string, s4, "@You currently have {reg4} gold on the bank."), 
	(str_store_string, s5, "@Visit our website at www.pw-nemesis.com"), 
	(multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s1),
         
	(call_script, "script_player_adjust_gold", ":player_id", ":gold", 1),	
 		 
	(multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),		
        (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s3),
        (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s4),
	(multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s5),

	(eq, ":deadleave", 0),
    (try_begin),
        (player_get_agent_id, ":agent_id", ":player_id"),
        (agent_is_active, ":agent_id"),
        (agent_is_alive, ":agent_id"),
	(call_script, "script_change_faction", ":player_id", ":faction_id", change_faction_type_respawn),
	(player_set_troop_id, ":player_id", ":troop_id"),
	(agent_set_hit_points, ":agent_id", ":hp", 1),
        (call_script, "script_cf_change_armour", ":agent_id", ":head_item_id"),
	(call_script, "script_cf_change_armour", ":agent_id", ":body_item_id"),
	(call_script, "script_cf_change_armour", ":agent_id", ":gloves_item_id"),
        (call_script, "script_cf_change_armour", ":agent_id", ":foot_item_id"),
	(gt, ":coordinate_x", 1),
	(init_position, pos48),
        (position_set_x, pos48, ":coordinate_x"),
        (position_set_y, pos48, ":coordinate_y"),
        (position_set_z, pos48, ":coordinate_z"),
        (agent_set_position, ":agent_id", pos48),
    (try_begin),
        (gt, ":item_1_id", 0),
        (agent_equip_item, ":agent_id", ":item_1_id"),
        (gt, ":item_2_id", 0),
        (agent_equip_item, ":agent_id", ":item_2_id"),
        (gt, ":item_3_id", 0),
        (agent_equip_item, ":agent_id", ":item_3_id"),
        (gt, ":item_4_id", 0),
        (agent_equip_item, ":agent_id", ":item_4_id"),
    (try_end),
    (try_begin),
        (gt, ":horse_id", 200),
	(lt, ":horse_id", 800),	
        (player_get_agent_id, ":player_agent_id", ":player_id"),
	(agent_is_active, ":player_agent_id"),
	(agent_is_alive, ":player_agent_id"),
	(agent_get_position, pos1, ":player_agent_id"),
	(position_move_x, pos1, 50),
	(position_set_z_to_ground_level, pos1),
	(set_spawn_position, pos1),
	(spawn_horse, ":horse_id"),
        (server_add_message_to_log,"@debug player spawning ended"),			  
    (try_end),
    (try_end),

    (else_try),
	(eq, ":deadleave", 
    (try_begin),
        (send_message_to_url, "@http://naoasisgate.avalon-gaming.com/removedeadleave.php?uniqueid={reg2}"),
	(call_script, "script_player_add_default_troop_items", ":player_id", ":troop_id"),
        (call_script, "script_player_add_default_troop_armor", ":player_id", ":troop_id"),
        (call_script, "script_player_add_spawn_items", ":player_id", 0),
    (try_end),
    (try_end),   
    (else_try),	
    (try_begin), #9099909909090999909090909888|1337|133733|333|17777|13333333|
	(eq, ":event", 9099909909090999909090909888),
	(server_add_message_to_log,"@debug deposit fired"),
        (assign, ":gold", reg3),
	(assign, ":bank", reg4),
	(assign, ":limit", reg5),
	(player_is_active, ":player_id"),  
	(str_store_player_username, s3, ":player_id"),  
        (player_get_gold, ":gold_value", ":player_id"),
        (gt, ":bank", ":limit"),
        (str_store_string, s2, "@[!] Bank Limit Reached [!]"),
	(multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),	
    (else_try),
        (player_is_active, ":player_id"),  
	(str_store_player_username, s3, ":player_id"),  
        (player_get_gold, ":gold_value", ":player_id"),
        (ge, ":gold_value", 5000),	
        (lt, ":bank", ":limit"),			  
	(call_script, "script_player_adjust_gold", ":player_id", 5000, -1),		  
	(store_add, ":plus", ":bank", 5000), 
	(assign, reg19, ":plus"),
	(str_store_string, s2, "@Depositing 5000, {reg19} gold in account"), 
        (send_message_to_url, "@http://naoasisgate.avalon-gaming.com/deposit.php?uniqueid={reg2}&localid=&{reg1}&username={s3}&bank=5000&deposit=5000"), 
        (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),	
    (else_try), 
	(eq, ":gold_value", 0),
        (str_store_string, s2, "@You dont have any money to deposit"), 
        (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),	
    (else_try),
        (lt, ":gold_value", 5000),
        (lt, ":bank", ":limit"),			  
	(player_get_gold, reg21, ":player_id"),
	(store_add, ":plus", ":bank", ":gold_value"), 		     			  
        (call_script, "script_player_adjust_gold", ":player_id", ":gold_value", -1),
	(send_message_to_url, "@http://naoasisgate.avalon-gaming.com/deposit.php?uniqueid={reg2}&localid=&{reg1}&username={s3}&bank={reg21}&deposit=5000"),  
        (assign, reg20, ":plus"),
        (str_store_string, s2, "@Depositing {reg21}, {reg20} gold in account"), 
        (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),		
    (try_end),
    (else_try),
    (try_begin), #9099909909090999909606|1337|133733|333|17777|13333333|
	(eq, ":event", 9099909909090999909606),
	(server_add_message_to_log,"@debug withdraw fired"),
        (assign, ":bank", reg4),
        (player_is_active, ":player_id"),
        (str_store_player_username, s3, ":player_id"), 
        (player_get_unique_id, ":uid", ":player_id"),
        (eq, ":unique_id", ":uid"),
        (eq, ":bank", 0),
       	(str_store_string, s2, "@You do not have enough money in your account"),			   
        (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),
    (else_try),
	(ge, ":bank", 5000),		
        (send_message_to_url, "@http://naoasisgate.avalon-gaming.com/withdraw.php?uniqueid={reg2}&localid=&{reg1}&username={s3}&bank=5000"),	
	(store_sub, ":min", ":bank", 5000), 
	(assign, reg5, ":min"),
        (str_store_string, s2, "@Withdrawing 5000, {reg5} gold in account"),				
        (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),			
        (call_script, "script_player_adjust_gold", ":player_id", 5000, 1),			
    (else_try),
        (lt, ":bank", 5000),	 
	(player_is_active, ":player_id"),
        (player_get_unique_id, ":uid", ":player_id"),
        (eq, ":unique_id", ":uid"),  		  
        (send_message_to_url, "@http://naoasisgate.avalon-gaming.com/withdraw.php?uniqueid={reg2}&localid=&{reg1}&username={s3}&bank={reg4}"),  	
	(str_store_string, s1, "@Withdrawing {reg4}, 0 gold in account"),   		  
	(multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s1),	
        (call_script, "script_player_adjust_gold", ":player_id", ":bank", 1),			
    (try_end), 		
    (else_try),
    (try_begin),
	(eq, ":event", 909990990909099977),
	(assign, ":troop_id", reg1),
        (player_is_active, ":player_id"),
	(player_set_troop_id, ":player_id", ":troop_id"),
    (try_end),	
    (else_try),
      (ge, ":integer_count", 1),
      (assign, ":return_code", reg0),
   (try_begin), # negative return codes are internal or configuration errors, not requiring action
	(server_add_message_to_log,"@debug name server fired"),
        (lt, ":return_code", 0),
        (server_add_message_to_log, "str_name_server_error_code_reg0"),
   (else_try), # return code 0 is success, don't kick the player
	(server_add_message_to_log,"@debug name server fired"),
        (eq, ":return_code", 0),
        (this_or_next|lt, ":integer_count", 4), # admin permissions not received
        (eq, reg3, -1), # admin permissions not set
   (else_try),
	(server_add_message_to_log,"@debug name server fired"),
        (ge, ":integer_count", 3),
        (ge, ":string_count", 1),
        (assign, ":player_id", reg1),
        (assign, ":unique_id", reg2),
        (player_is_active, ":player_id"),
        (player_get_unique_id, ":player_unique_id", ":player_id"),
        (eq, ":player_unique_id", ":unique_id"),
    (try_begin), # positive return codes are for rejecting the player
          (gt, ":return_code", 0),
    (try_begin),
            (eq, ":return_code", 4),
            (assign, ":rejection_string_id", "str_kicked_not_registered"),
    (else_try),
            (eq, ":return_code", 3),
            (assign, ":rejection_string_id", "str_kicked_using_invalid_name"),
    (else_try),
            (eq, ":return_code", 2),
            (assign, ":rejection_string_id", "str_kicked_using_other_clan_tag"),
    (else_try),
            (assign, ":rejection_string_id", "str_kicked_using_other_players_name"),
    (try_end),
          (multiplayer_send_2_int_to_player, ":player_id", server_event_preset_message, ":rejection_string_id", preset_message_error|preset_message_log),
          (store_mission_timer_a, ":time"), # kick the player after a short delay to try ensure they see the rejection message
          (val_add, ":time", name_server_kick_delay_interval),
          (player_set_slot, ":player_id", slot_player_kick_at_time, ":time"),
          (str_store_string, s10, ":rejection_string_id"),
          (server_add_message_to_log, "str_name_server_log_s10"),
    (try_end),
    (try_begin), # admin permissions were received
          (ge, ":integer_count", 4),
          (player_is_admin, ":player_id"),
          (assign, ":admin_permissions", reg3),
          (val_max, ":admin_permissions", 0),
          (call_script, "script_player_set_admin_permissions", ":player_id", ":admin_permissions"),
          (multiplayer_send_int_to_player, ":player_id", server_event_admin_set_permissions, ":admin_permissions"),
		  (eq, ":admin_permissions", 0), #passleak
          (player_set_is_admin, ":player_id", 0), #passleak
          (kick_player, ":player_id"), #passleak
    (try_end),
    (else_try),
        (server_add_message_to_log, "str_name_server_invalid_response"),
    (try_end),
    (try_end),
    (try_end),
    ]),
 
("game_receive_url_response", # called by the game when a response is received from a web server, if used
  [(store_script_param, ":integer_count", 1),
    (store_script_param, ":string_count", 2),
  (assign, "$g_name_server_enabled", 1),


Why you have (assign, "$g_name_server_enabled", 1), here?
 
so the global variable name server is set to on.

That is not the issue with the code, there has to be something wrong with the formatting, I have referenced all 3 working sets of scripts i have in my module collection, and cannot pinpoint the issue. 
 
Xaphan said:
and as I tried to explain using a return code ****s up the name server.

The first int would have to be something useless that is too big for the name server to bother with, followed by the event, and just for safety the first returns would need to be useless strings.
No, the default name server will not handle anything unless the first number is negative or 0, 1, 2, 3, 4; other than to put a "Name server: invalid response" message in the logs if you didn't add a case to the main try block for your message return codes (which will not affect how anything else works). If trying to use return codes seems to mess up the name server, it is because you have broken the control flow with unbalanced try_begin or try_end operations, changing the meaning of try blocks later in the script.
Xaphan said:
I'm hoping maybe vornne can take a look, and see if I formatted the code correctly such as try begins and try ends in the right spots to create a client response script.
Sorry, I won't look at that script unless the indentation is fixed to be consistent: I would need to spend the time to fix it myself to be able to understand the control flow at a glance. In cleaning up the indentation you might find the problem yourself.
 
but the problem is in fact the try begin try end flow, i know it is, i'm not sure if i'm supposed to open up with a try_begin, than have a try_begin for each script within the first try begin's flow, or if I need to completely close each script to allow the next one to work properly.

I hope it won't take too much time out of your day to briefly explain code flow. :/

I fixed the indentations, but left the name server area formatted how you coded it. 
 
Xaphan said:
My true problem is lack of documentation, and the people who know things well, not helping by collaboratively documenting the modding language.

If recall correctly from our last Steam chat conversation, you consider me as a one who 'knows well things'.
So, I have never learnt from any documentation for Warband developement. But I won't hide you I'd have learnt basics faster with it.
All my knowledge comes from Vornne who has been answering all my questions in my thread 'Some Little Questions', his well written Module System version of Persistent World (thanks Vornne) and because I tried at my maximum get things right the most possible and also because I was experimenting, oh yes, for this last one, I spent dozen and dozen of hours experimenting and I'm glad I did, by doing this way I learnt so many things that weren't even related to the issues I was encountering in the past but served me later. I feel like it is a shore for you to do this, maybe should you try to take problems like a challenge, asking for help is being beaten by the MS. Maybe try to get more into your project and see that as a challenge.

But yeeeh, those were simply my two cents.
 
Well I am busy with my own mod, I am simply trying to provide a fix for my friends over at oasis who are dealing with script issues while currently supporting the whole player base for both NA and EU. 

I am asking here because in my own module, I am having zero issues with url responses. 

I do not have the time or drive to fully figure out why there is an issue with this specific return code for PW, or any return code which has anything to do with vornne's name server being thrown into the mix.

I got this exact system working with my own make shift name server set up.

My hands are tied, I do not know what the problem is. 

I am seeking help from people who may know because I am still trying to help PW at the same time of being very busy with my first own creation. 

I'm not really a staff member for oasis, I am doing it for the players, they want the HP system fixed, which I cannot fix while oasis uses danyele's scripts.

For some reason danyele won't make the simple hp percent changes for them when he used to do it for me. 

While allowing gishank to force them to pay for a server they are not using as part of the deal in order to use the scripts.  I know the scripts themselves are costing around 15 - 20 euro monthly, than they added a useless server to the bill just because it is their way or the highway.  So i'm assuming they are spending around 40 - 50 euro on top of server expenses, which in my mind is un-needed, and potentially damaging. 

So in an attemp to contribute to the current hosting team housing all the players, busting their asses off training and dealing with admins, security concerns, scene creation, the whole cup of tea in regauds to catering to the PW community.  I want to help assure their longevity by decreasing their monthly expenses. 

As you can see, this is not my job, this is everyone's job, who cares about fareness and the prosperity of the mod. 

I am getting nothing in return, I am simply trying to help, and for me to help, i kind of need some help. 

hope you understand now. 

EDIT: This system will be fully functional and ready for oasis to use once this forsaken return script is fixed.
 
It has always been the policy that to utilise the PW Scriptset we offer, you must order a 100 slot server as a minimum requirement. It is completely absurd for you to claim that we are forcing them to pay for our service under the guise of it's our way or the highway. There are a number of free Persistent World scripts that are available, several of which were available prior to us even offering this service. We make no promise to provide custom versions of the scriptset to our customers, though we do try to fulfil any requests we receive of this nature we are in no way obligated to do so. It's entirely up to DanyEle, where he has the time to fulfil such a request, I am however unaware of any request made by the Oasis team to this effect.
 
I'm incredibly curious as to how you keep formulating these outlandish statements and accusations, all fees are made explicitly clear on our website and forum threads. When an interested party contacts myself, I also make it clear the price they are paying and what they break down in to. Pricing is effected by a number of factors, including by not limited to expenses, our active competition, bandwidth, etc. I've never claimed that I created the scriptset (something of which you seem to imply given the tone of your post), the scriptset was indeed created by DanyEle with a few backend modifications made by myself over time.  We have had many satisfied customers over the years we have been operating, the overwhelming majority of which are non-PW related.

Whilst you are entitled to your rather skewed opinion, I must admit I find it quite hilarious.
 
I am removing my post and walking away, i don't want to have an argument, and I don't think anyone else wants to read an argument. 

 
Xaphan said:
My latest attempt from today
The updated formatting seems more consistent, but is very misleading and wrong: you should only increase the indentation level after a try_begin, try_for_range, try_for_range_backwards, try_for_parties, try_for_agents, etc. operation, only decrease it before a try_end operation, and decrease and increase it around an else_try operation. See STYLE.txt in the PW module system for instructions to follow the same style as the official code.

Your quoted code has a very different overall appearance when indented correctly, generally creeping over to the right (I did it this time just as an example, not as a continuing service):
Code:
  ("game_receive_url_response", # called by the game when a response is received from a web server, if used
   [(store_script_param, ":integer_count", 1),
    (store_script_param, ":string_count", 2),
    (assign, "$g_name_server_enabled", 1),
    (try_begin),
      (eq, ":integer_count", 0),
      (eq, ":string_count", 1),
      (display_message, s0),#error will display in console window
    (else_try),
      (gt, ":integer_count", 0),#just in case
      (assign, ":event", reg0),
      (display_message, "@{reg0}"),
      (try_begin),
        (eq, ":event", -1),#could not connect to mysql server
        (display_message, "@Could not connect to the database!"),
      (else_try),
        (assign, ":player_id", reg1),
        (assign, ":unique_id", reg2),

        (eq, ":event", 1),#player spawning
        (try_begin), #9099909909090999909090909|123|133733|333|7777|1|2|3|4|13|5|6|7|8|14|9|10|11|12|44|33|15|
          (eq, ":event", 9099909909090999909090909),
          (server_add_message_to_log,"@debug player spawning started"),
          (assign, ":gold", reg3),
          (assign, ":player_id", reg1),
          (assign, ":unique_id", reg2),
          (assign, ":head_item_id", reg5),
          (assign, ":body_item_id", reg6),
          (assign, ":gloves_item_id", reg7),
          (assign, ":foot_item_id", reg8),
          (assign, ":horse_id", reg9),
          (assign, ":item_1_id", reg10),
          (assign, ":item_2_id", reg11),
          (assign, ":item_3_id", reg12),
          (assign, ":item_4_id", reg13),
          (assign, ":troop_id", reg14),
          (assign, ":coordinate_x", reg15),
          (assign, ":coordinate_y", reg16),
          (assign, ":coordinate_z", reg17),
          (assign, ":deadleave", reg18),
          (assign, ":hp", reg19),
          (assign, ":food_amount", reg20),
          (assign, ":faction_id", reg21),

          (player_is_active, ":player_id"),
          (player_get_unique_id, ":uid", ":player_id"),

          (eq, ":unique_id", ":uid"),
          (str_store_player_username, s5, ":player_id"),
          (str_store_string, s1, "@Loading character data..."),
          (str_store_string, s2, "@Welcome {s5} to Nemesis! Your GUID is {reg2}."),
          (str_store_string, s3, "@Your PIN is {s0} Do not share PIN!"),
          (str_store_string, s4, "@You currently have {reg4} gold on the bank."),
          (str_store_string, s5, "@Visit our website at www.pw-nemesis.com"),
          (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s1),

          (call_script, "script_player_adjust_gold", ":player_id", ":gold", 1),

          (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),
          (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s3),
          (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s4),
          (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s5),

          (eq, ":deadleave", 0),
          (try_begin),
            (player_get_agent_id, ":agent_id", ":player_id"),
            (agent_is_active, ":agent_id"),
            (agent_is_alive, ":agent_id"),
            (call_script, "script_change_faction", ":player_id", ":faction_id", change_faction_type_respawn),
            (player_set_troop_id, ":player_id", ":troop_id"),
            (agent_set_hit_points, ":agent_id", ":hp", 1),
            (call_script, "script_cf_change_armour", ":agent_id", ":head_item_id"),
            (call_script, "script_cf_change_armour", ":agent_id", ":body_item_id"),
            (call_script, "script_cf_change_armour", ":agent_id", ":gloves_item_id"),
            (call_script, "script_cf_change_armour", ":agent_id", ":foot_item_id"),
            (gt, ":coordinate_x", 1),
            (init_position, pos48),
            (position_set_x, pos48, ":coordinate_x"),
            (position_set_y, pos48, ":coordinate_y"),
            (position_set_z, pos48, ":coordinate_z"),
            (agent_set_position, ":agent_id", pos48),
            (try_begin),
              (gt, ":item_1_id", 0),
              (agent_equip_item, ":agent_id", ":item_1_id"),
              (gt, ":item_2_id", 0),
              (agent_equip_item, ":agent_id", ":item_2_id"),
              (gt, ":item_3_id", 0),
              (agent_equip_item, ":agent_id", ":item_3_id"),
              (gt, ":item_4_id", 0),
              (agent_equip_item, ":agent_id", ":item_4_id"),
            (try_end),
            (try_begin),
              (gt, ":horse_id", 200),
              (lt, ":horse_id", 800),
              (player_get_agent_id, ":player_agent_id", ":player_id"),
              (agent_is_active, ":player_agent_id"),
              (agent_is_alive, ":player_agent_id"),
              (agent_get_position, pos1, ":player_agent_id"),
              (position_move_x, pos1, 50),
              (position_set_z_to_ground_level, pos1),
              (set_spawn_position, pos1),
              (spawn_horse, ":horse_id"),
              (server_add_message_to_log,"@debug player spawning ended"),
            (try_end),
          (try_end),

        (else_try),
          (eq, ":deadleave",
          (try_begin),
            (send_message_to_url, "@http://naoasisgate.avalon-gaming.com/removedeadleave.php?uniqueid={reg2}"),
            (call_script, "script_player_add_default_troop_items", ":player_id", ":troop_id"),
            (call_script, "script_player_add_default_troop_armor", ":player_id", ":troop_id"),
            (call_script, "script_player_add_spawn_items", ":player_id", 0),
          (try_end),
        (try_end),
      (else_try),
        (try_begin), #9099909909090999909090909888|1337|133733|333|17777|13333333|
          (eq, ":event", 9099909909090999909090909888),
          (server_add_message_to_log,"@debug deposit fired"),
          (assign, ":gold", reg3),
          (assign, ":bank", reg4),
          (assign, ":limit", reg5),
          (player_is_active, ":player_id"),
          (str_store_player_username, s3, ":player_id"),
          (player_get_gold, ":gold_value", ":player_id"),
          (gt, ":bank", ":limit"),
          (str_store_string, s2, "@[!] Bank Limit Reached [!]"),
          (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),
        (else_try),
          (player_is_active, ":player_id"),
          (str_store_player_username, s3, ":player_id"),
          (player_get_gold, ":gold_value", ":player_id"),
          (ge, ":gold_value", 5000),
          (lt, ":bank", ":limit"),
          (call_script, "script_player_adjust_gold", ":player_id", 5000, -1),
          (store_add, ":plus", ":bank", 5000),
          (assign, reg19, ":plus"),
          (str_store_string, s2, "@Depositing 5000, {reg19} gold in account"),
          (send_message_to_url, "@http://naoasisgate.avalon-gaming.com/deposit.php?uniqueid={reg2}&localid=&{reg1}&username={s3}&bank=5000&deposit=5000"),
          (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),
        (else_try),
          (eq, ":gold_value", 0),
          (str_store_string, s2, "@You dont have any money to deposit"),
          (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),
        (else_try),
          (lt, ":gold_value", 5000),
          (lt, ":bank", ":limit"),
          (player_get_gold, reg21, ":player_id"),
          (store_add, ":plus", ":bank", ":gold_value"),
          (call_script, "script_player_adjust_gold", ":player_id", ":gold_value", -1),
          (send_message_to_url, "@http://naoasisgate.avalon-gaming.com/deposit.php?uniqueid={reg2}&localid=&{reg1}&username={s3}&bank={reg21}&deposit=5000"),
          (assign, reg20, ":plus"),
          (str_store_string, s2, "@Depositing {reg21}, {reg20} gold in account"),
          (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),
        (try_end),
      (else_try),
        (try_begin), #9099909909090999909606|1337|133733|333|17777|13333333|
          (eq, ":event", 9099909909090999909606),
          (server_add_message_to_log,"@debug withdraw fired"),
          (assign, ":bank", reg4),
          (player_is_active, ":player_id"),
          (str_store_player_username, s3, ":player_id"),
          (player_get_unique_id, ":uid", ":player_id"),
          (eq, ":unique_id", ":uid"),
          (eq, ":bank", 0),
          (str_store_string, s2, "@You do not have enough money in your account"),
          (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),
        (else_try),
          (ge, ":bank", 5000),
          (send_message_to_url, "@http://naoasisgate.avalon-gaming.com/withdraw.php?uniqueid={reg2}&localid=&{reg1}&username={s3}&bank=5000"),
          (store_sub, ":min", ":bank", 5000),
          (assign, reg5, ":min"),
          (str_store_string, s2, "@Withdrawing 5000, {reg5} gold in account"),
          (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),
          (call_script, "script_player_adjust_gold", ":player_id", 5000, 1),
        (else_try),
          (lt, ":bank", 5000),
          (player_is_active, ":player_id"),
          (player_get_unique_id, ":uid", ":player_id"),
          (eq, ":unique_id", ":uid"),
          (send_message_to_url, "@http://naoasisgate.avalon-gaming.com/withdraw.php?uniqueid={reg2}&localid=&{reg1}&username={s3}&bank={reg4}"),
          (str_store_string, s1, "@Withdrawing {reg4}, 0 gold in account"),
          (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s1),
          (call_script, "script_player_adjust_gold", ":player_id", ":bank", 1),
        (try_end),
      (else_try),
        (try_begin),
          (eq, ":event", 909990990909099977),
          (assign, ":troop_id", reg1),
          (player_is_active, ":player_id"),
          (player_set_troop_id, ":player_id", ":troop_id"),
        (try_end),
      (else_try),
        (ge, ":integer_count", 1),
        (assign, ":return_code", reg0),
        (try_begin), # negative return codes are internal or configuration errors, not requiring action
          (server_add_message_to_log,"@debug name server fired"),
          (lt, ":return_code", 0),
          (server_add_message_to_log, "str_name_server_error_code_reg0"),
        (else_try), # return code 0 is success, don't kick the player
          (server_add_message_to_log,"@debug name server fired"),
          (eq, ":return_code", 0),
          (this_or_next|lt, ":integer_count", 4), # admin permissions not received
          (eq, reg3, -1), # admin permissions not set
        (else_try),
          (server_add_message_to_log,"@debug name server fired"),
          (ge, ":integer_count", 3),
          (ge, ":string_count", 1),
          (assign, ":player_id", reg1),
          (assign, ":unique_id", reg2),
          (player_is_active, ":player_id"),
          (player_get_unique_id, ":player_unique_id", ":player_id"),
          (eq, ":player_unique_id", ":unique_id"),
          (try_begin), # positive return codes are for rejecting the player
            (gt, ":return_code", 0),
            (try_begin),
              (eq, ":return_code", 4),
              (assign, ":rejection_string_id", "str_kicked_not_registered"),
            (else_try),
              (eq, ":return_code", 3),
              (assign, ":rejection_string_id", "str_kicked_using_invalid_name"),
            (else_try),
              (eq, ":return_code", 2),
              (assign, ":rejection_string_id", "str_kicked_using_other_clan_tag"),
            (else_try),
              (assign, ":rejection_string_id", "str_kicked_using_other_players_name"),
            (try_end),
            (multiplayer_send_2_int_to_player, ":player_id", server_event_preset_message, ":rejection_string_id", preset_message_error|preset_message_log),
            (store_mission_timer_a, ":time"), # kick the player after a short delay to try ensure they see the rejection message
            (val_add, ":time", name_server_kick_delay_interval),
            (player_set_slot, ":player_id", slot_player_kick_at_time, ":time"),
            (str_store_string, s10, ":rejection_string_id"),
            (server_add_message_to_log, "str_name_server_log_s10"),
          (try_end),
          (try_begin), # admin permissions were received
            (ge, ":integer_count", 4),
            (player_is_admin, ":player_id"),
            (assign, ":admin_permissions", reg3),
            (val_max, ":admin_permissions", 0),
            (call_script, "script_player_set_admin_permissions", ":player_id", ":admin_permissions"),
            (multiplayer_send_int_to_player, ":player_id", server_event_admin_set_permissions, ":admin_permissions"),
            (eq, ":admin_permissions", 0), #passleak
            (player_set_is_admin, ":player_id", 0), #passleak
            (kick_player, ":player_id"), #passleak
          (try_end),
        (else_try),
          (server_add_message_to_log, "str_name_server_invalid_response"),
        (try_end),
      (try_end),
    (try_end),
    ]),
There are some obvious things that make no sense:
Code:
        (eq, ":event", 1),#player spawning
        (try_begin), #9099909909090999909090909|123|133733|333|7777|1|2|3|4|13|5|6|7|8|14|9|10|11|12|44|33|15|
          (eq, ":event", 9099909909090999909090909),
The operations in the block after this can never happen: first you ensure that ":event" is 1, then you try check it is 9099909909090999909090909?
Code:
      (else_try),
        (try_begin),
          (eq, ":event", 909990990909099977),
          (assign, ":troop_id", reg1),
          (player_is_active, ":player_id"),
          (player_set_troop_id, ":player_id", ":troop_id"),
        (try_end),
      (else_try),
You might think you are being extra careful by adding the extra try_begin try_end block, but in reality you are just breaking the control flow: when you have a ladder like structure of sections starting with else_try, handing a different event number, each block must either handle the event, or fail and then skip to the next event number test. So for a general structure like this:
Code:
  (assign, ":return_code", reg0),
  (try_begin),
    (eq, ":return_code", 1),
    # handle message 1
  (else_try),
    (try_begin),
      (eq, ":return_code", 2),
      # handle message 2
    (try_end),
  (else_try),
    (eq, ":return_code", 3),
    # handle message 3
  (try_end),
With this code, the message with the return code of 3 can never be handled, because the control flow gets to the block handling message 2, enters another block which has the test eq -> 2, and even if it fails (because the return code is 3) the control will not pass to the next handler blocks, because it has already skipped out to the nearest try_end, then the enclosing else_try section succeeds, with no need to try the eq -> 3 test. When using operations that change the control flow of a script, you need to know exactly what they will do, place them very carefully, and use indentation to make the meaning of the enclosed code clear at a glance; they should never be used superstitiously or haphazardly.
Code:
       (try_begin), #9099909909090999909090909888|1337|133733|333|17777|13333333|
          (eq, ":event", 9099909909090999909090909888),
          (server_add_message_to_log,"@debug deposit fired"),
          (assign, ":gold", reg3),
          (assign, ":bank", reg4),
          (assign, ":limit", reg5),
          (player_is_active, ":player_id"),
          (str_store_player_username, s3, ":player_id"),
          (player_get_gold, ":gold_value", ":player_id"),
          (gt, ":bank", ":limit"),
          (str_store_string, s2, "@[!] Bank Limit Reached [!]"),
          (multiplayer_send_string_to_player, ":player_id", server_event_local_chat, s2),
        (else_try),
          (player_is_active, ":player_id"),
          (str_store_player_username, s3, ":player_id"),
          (player_get_gold, ":gold_value", ":player_id"),
          (ge, ":gold_value", 5000),
          (lt, ":bank", ":limit"),
This is wrong because you are checking undefined local variables: either ":event" is 9099909909090999909090909888, and the local variables ":bank" ":limit" and ":gold_value" are assigned, or ":event" is not 9099909909090999909090909888, those local variables are never set, and then they are tested and compared (which would either succeed or fail randomly, depending on what those memory locations were used for previously by the game engine). When using a local variable for any operation that uses the value rather than overwriting (or setting) it, you need to ensure it was always initialized to something in the code preceeding, no matter which code path was used. So in this case, you probably don't want to try using those values without them being set from the url response message, but in some cases you might want to set some default "fallback" values in case a try block didn't set them, for example:
Code:
  (assign, ":gold_value", 100),
  (try_begin),
    (eq, ":player_id", 43),
    (player_get_gold, ":gold_value", ":player_id"),
  (try_end),
  (gt, ":gold_value", 3),
  (val_sub, ":gold_value", 1),
So if the player id doesn't happen to be 43 (or whatever other checks you wanted), the gold value used will default to 100, and the last two operations will not check and adjust garbage values.
 
Thank you for a very informative lesson.  The time you took out of your day to clarify these things is something I am very grateful of.

This is going to take a few reads through and maybe a few days to process. 
 
Back
Top Bottom