public void logout() {
		if(getGameState() != GameState.LOGIN){ 
			if(ctx.players.getLocalPlayer().isInCombat()) {
				long curr = System.currentTimeMillis();
				while(System.currentTimeMillis() - curr < 5000 && ctx.players.getLocalPlayer().isInCombat()) {
					Utils.sleep(20); // wait up to 5 seconds for combat to end
				}
			} else {
				if(getCurrentTab() != Tabs.LOGOUT) {
					openTab(Tabs.LOGOUT);
				} else {
					ctx.mouse.click(644, 379);
				}
			}
		}
	}