Jump to content
  • 0

query_sql problem..


nasagnilac

Question


  • Group:  Members
  • Topic Count:  89
  • Topics Per Day:  0.02
  • Content Count:  232
  • Reputation:   15
  • Joined:  11/02/13
  • Last Seen:  

Hi I need some help to my script..

-	script	autokicker	-1,{
OnLoginEvent:
                set @name$,strcharinfo(0);
		set .@acc, getcharid(3);
		query_sql ("SELECT `account_id`,`last_mac` FROM `login` WHERE `account_id` = '"+.@acc+"'",.@dacc,.@dmac$);
		for(set .@i,0; .@i<128; set .@i,.@i+1)
				query_sql ("SELECT `account_id` FROM `login` WHERE `last_mac` = '"+.@dmac$+"'",.@dacc1);
				query_sql ("SELECT `account_id`,`char_id`,`online` FROM `char` WHERE `online` = '1' AND `account_id` = '"+.@dacc1+"'",.@wacc, .@wchar,.@online);
			if(getarraysize(.@online) != 1){
					if (isloggedin(.@wacc[.@i],.@wchar[.@i])) {
					mes "[System]";
					mes "Dual Client is disabled in WoE time";
					close2;
					atcommand "@kick "+@name$+"";
					}
			}
end;
}

I am making a auto kicker for those who dual client every woe. I am using Euphy's WOE Controller so I want to avoid lot of alts for WoE Prizes. This will count the numbers of online with the same mac address to the one who login and if its more than 1 it will kick all the accounts with the mac addresses.My problem is the message don't appear when I login my 2 test accounts maybe there is a problem with my query_sql so please help me..... Thank in advance.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

-	script	auto_kicker	-1,{

OnPCLoadMapEvent:

if ( ( agitcheck() || agitcheck2() ) && getmapflag( strcharinfo(3), mf_gvg_castle ) ) {

query_sql "select count(1) from `char` right join login on login.account_id = `char`.account_id where `char`.online = 1 and login.last_ip = '"+ getcharip() +"'", .@count ;

if ( .@count >= 2 ) {

mes "Dual Client is disabled in WoE time";

close2;

atcommand "@kick "+ strcharinfo(0);

end;

}

}

end;

}

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  89
  • Topics Per Day:  0.02
  • Content Count:  232
  • Reputation:   15
  • Joined:  11/02/13
  • Last Seen:  

hmmm I guess this is wrong..

 

-	script	auto_kicker	-1,{
OnPCLoadMapEvent:
	if ( ( agitcheck() || agitcheck2() ) && getmapflag( strcharinfo(3), mf_gvg_castle ) ) {
		query_sql "select count(1) from `char` right join login on login.account_id = `char`.account_id where `char`.online = 1 and login.last_ip = '"+ getcharip() +"'", .@count ;
		if ( .@count >= 2 ) {
			mes "Dual Client is disabled in WoE time";
			close2;
			atcommand "@kick "+ strcharinfo(0);
			end;
		}
	}
	end;
}

 

I want it to kick the all the previous online with the same mac address of the one login.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

try rephrase your question ...

choose your scenario

1. if I login account A, and dual client account B, both account will be kick

2. if I login account A, and dual client account B, account A will be kick

3. if I login account A, and dual client account B, account B will be kick

the above script actually did with scenario 3

so actually you wanted scenario 1 or scenario 2 ?

btw, euphy woe controller already has loadevent on all castles

https://github.com/rathena/rathena/blob/master/npc/custom/woe_controller.txt#L97

also, can just change last_ip into last_mac ...

I don't have harmony, so I usually just do a wild guess

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  89
  • Topics Per Day:  0.02
  • Content Count:  232
  • Reputation:   15
  • Joined:  11/02/13
  • Last Seen:  

the number 1 scenario...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

-	script	auto_kicker	-1,{

OnPCLoadMapEvent:

if ( ( agitcheck() || agitcheck2() ) && getmapflag( strcharinfo(3), mf_gvg_castle ) )

goto L_kick;

end;

OnPCLoginEvent:

if ( agitcheck() || agitcheck2() )

goto L_kick;

end;

L_kick:

.@nb = query_sql( "select `login`.account_id from `char` right join login on login.account_id = `char`.account_id where `char`.online = 1 and login.last_ip = ( select last_ip from login where account_id = "+ getcharid(3) +" )", .@aid );

if ( .@nb >= 2 ) {

for ( .@i = 0; .@i < .@nb; .@i++ ) {

attachrid .@aid[.@i];

addtimer 1, strnpcinfo(0)+"::Onkick";

}

}

end;

Onkick:

mes "Dual Client is disabled in WoE time";

sleep2 1000;

atcommand "@kick "+ strcharinfo(0);

end;

}

change last_ip into last_mac Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  89
  • Topics Per Day:  0.02
  • Content Count:  232
  • Reputation:   15
  • Joined:  11/02/13
  • Last Seen:  

That code kicks both characters that equal sam to 2 or more than?

Edited by gmprestige
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...