Thread: 718 Bank - Equipment Interface Issue

Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22
  1. #11  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Been getting PMs for this, so little gravedig:

    Code:
     // send this 1 tick after opening the interface (reason explained below)
    
    player.getPackets().sendConfigByFile(8348, 0); // 0 when opening bank, 1 when opening equipment I think
    player.getPackets().sendRunScript(2319); // refresh the bank/equip interface depending on the value of varbit 8348
    Project thread
    Reply With Quote  
     

  2. Thankful user:


  3. #12  
    Registered Member

    Join Date
    Dec 2009
    Posts
    774
    Thanks given
    367
    Thanks received
    455
    Rep Power
    927
    The proper way to fix this is to send script 2319 one game tick after you send the equipment interface.
    link removed
    Reply With Quote  
     

  4. Thankful user:


  5. #13  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Quote Originally Posted by Admiral Slee View Post
    The proper way to fix this is to send script 2319 one game tick after you send the equipment interface.
    The script needs the value of this config to be set:

    Code:
    void script_2319() {
    	if (((boolean)bitconfig_8348)) {
    		setWidgetIsHidden(true, new WidgetPointer(762,0));
    		setWidgetIsHidden(true, new WidgetPointer(763,0));
    		setWidgetIsHidden(false, new WidgetPointer(667,0));
    		setWidgetIsHidden(false, new WidgetPointer(763,1));
    	} else {
    		setWidgetIsHidden(false, new WidgetPointer(762,0));
    		setWidgetIsHidden(false, new WidgetPointer(763,0));
    		setWidgetIsHidden(true, new WidgetPointer(667,0));
    		setWidgetIsHidden(true, new WidgetPointer(763,1));
    	}
    	script_722();
    	return;
    }
    And since only setting the value of the config works, I'm pretty sure the script is called automatically.
    Project thread
    Reply With Quote  
     

  6. #14  
    Registered Member

    Join Date
    Dec 2009
    Posts
    774
    Thanks given
    367
    Thanks received
    455
    Rep Power
    927
    Quote Originally Posted by clem585 View Post
    The script needs the value of this config to be set:

    Code:
    void script_2319() {
    	if (((boolean)bitconfig_8348)) {
    		setWidgetIsHidden(true, new WidgetPointer(762,0));
    		setWidgetIsHidden(true, new WidgetPointer(763,0));
    		setWidgetIsHidden(false, new WidgetPointer(667,0));
    		setWidgetIsHidden(false, new WidgetPointer(763,1));
    	} else {
    		setWidgetIsHidden(false, new WidgetPointer(762,0));
    		setWidgetIsHidden(false, new WidgetPointer(763,0));
    		setWidgetIsHidden(true, new WidgetPointer(667,0));
    		setWidgetIsHidden(true, new WidgetPointer(763,1));
    	}
    	script_722();
    	return;
    }
    And since only setting the value of the config works, I'm pretty sure the script is called automatically.
    That's correct, the varpbit is also needed. But there's no interface component that listens to this varpbit, you need to call the script.
    link removed
    Reply With Quote  
     

  7. Thankful user:


  8. #15  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Quote Originally Posted by Admiral Slee View Post
    That's correct, the varpbit is also needed. But there's no interface component that listens to this varpbit, you need to call the script.
    Oh yep my bad

    Code:
    	public void openBank() {
    		bonestoOffer.stopOfferGod = true;
    		if (player.getHitpoints() < player.getMaxHitpoints()) {
    			player.applyHit(new Hit(player, (player.getHitpoints() + player.getMaxHitpoints() > player.getMaxHitpoints() ? (player.getMaxHitpoints()-player.getHitpoints()) : player.getMaxHitpoints()), HitLook.HEALED_DAMAGE));
    		}
    		player.getInterfaceManager().sendInterface(762);
    		player.getInterfaceManager().sendInventoryInterface(763);
    		player.getPackets().sendConfigByFile(8348, 0);
    		player.getPackets().sendRunScript(2319);
    		refreshViewingTab();
    		refreshTabs();
    		unlockButtons();
    		sendItems();
    		refreshLastX();
    	}
    Edited first answer
    Project thread
    Reply With Quote  
     

  9. #16  
    Registered Member
    hc747's Avatar
    Join Date
    Dec 2013
    Age
    26
    Posts
    1,474
    Thanks given
    3,312
    Thanks received
    691
    Rep Power
    1098
    Quote Originally Posted by Admiral Slee View Post
    The proper way to fix this is to send script 2319 one game tick after you send the equipment interface.
    Out of curiosity, why does there have to be the one tick delay?
    Reply With Quote  
     

  10. #17  
    Registered Member
    Stimulant's Avatar
    Join Date
    Jan 2013
    Age
    27
    Posts
    1,457
    Thanks given
    248
    Thanks received
    187
    Rep Power
    578
    Quote Originally Posted by clem585 View Post
    Oh yep my bad

    Code:
    	public void openBank() {
    		bonestoOffer.stopOfferGod = true;
    		if (player.getHitpoints() < player.getMaxHitpoints()) {
    			player.applyHit(new Hit(player, (player.getHitpoints() + player.getMaxHitpoints() > player.getMaxHitpoints() ? (player.getMaxHitpoints()-player.getHitpoints()) : player.getMaxHitpoints()), HitLook.HEALED_DAMAGE));
    		}
    		player.getInterfaceManager().sendInterface(762);
    		player.getInterfaceManager().sendInventoryInterface(763);
    		player.getPackets().sendConfigByFile(8348, 0);
    		player.getPackets().sendRunScript(2319);
    		refreshViewingTab();
    		refreshTabs();
    		unlockButtons();
    		sendItems();
    		refreshLastX();
    	}
    Edited first answer
    I tested it, it seems you don't need to send the script when opening the bank, the varbit 8348 with value 0 will fix this part. Now I'm looking into fixing the equipment part from the tab.

    Code:
    public void openBank() {
    		player.getInterfaceManager().sendInterface(762);
    		player.getInterfaceManager().sendInventoryInterface(763);
    		player.getPackets().sendVarBit(8348, 0);
    		// player.getPackets().sendRunScript(2319);
    		sendItems();
    		unlockButtons();
    		refreshViewingTab();
    		refreshTabs();
    		refreshLastX();
    		refreshBankSpace();
    	}
    Reply With Quote  
     

  11. #18  
    Registered Member

    Join Date
    Dec 2009
    Posts
    774
    Thanks given
    367
    Thanks received
    455
    Rep Power
    927
    Quote Originally Posted by hc747 View Post
    Out of curiosity, why does there have to be the one tick delay?
    Because the client may process your script call earlier than opening the interface. Opening the interface costs render power. A script call is extremely fast. The script must be called after the interface has been opened.
    link removed
    Reply With Quote  
     

  12. Thankful users:


  13. #19  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Quote Originally Posted by Admiral Slee View Post
    Because the client may process your script call earlier than opening the interface. Opening the interface costs render power. A script call is extremely fast. The script must be called after the interface has been opened.
    Ah, that explains why my dungeoneering party was messed up seemingly randomly and why some interfaces on actual RS have delays.
    Project thread
    Reply With Quote  
     

  14. #20  
    Registered Member
    Stimulant's Avatar
    Join Date
    Jan 2013
    Age
    27
    Posts
    1,457
    Thanks given
    248
    Thanks received
    187
    Rep Power
    578
    Quote Originally Posted by Admiral Slee View Post
    Because the client may process your script call earlier than opening the interface. Opening the interface costs render power. A script call is extremely fast. The script must be called after the interface has been opened.
    Thanks, learned something today, managed to fix it properly now.
    Reply With Quote  
     

Page 2 of 3 FirstFirst 123 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. 718 removing equipment from equipment interface
    By OodlesOfNoodles in forum Help
    Replies: 1
    Last Post: 06-24-2014, 07:21 AM
  2. 718 Interface issue.
    By Ynneh in forum Help
    Replies: 0
    Last Post: 11-08-2013, 01:57 AM
  3. bank pin interface issue
    By Turkey Kush in forum Help
    Replies: 1
    Last Post: 07-26-2013, 11:13 AM
  4. Replies: 11
    Last Post: 03-24-2013, 02:33 AM
  5. bank interface issues
    By tony0 in forum Help
    Replies: 4
    Last Post: 01-01-2013, 04:07 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •