Jump to content
  • 0

[Error]: buildin_getmapxy:


LearningRO

Question


  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

hi, after i update my rathena into this commit https://github.com/rathena/rathena/commit/26720f041a3cd0edbaa975bfc70345a30e9bf706

this script not working anymore

 

-	script	kjdshfksfj	FAKE_NPC,{
OnInit:	
	bindatcmd "sameip", strnpcinfo(0)+"::Onaaa", 14, 99;
	end;
Onaaa:	
	freeloop true;	
	.@nb = query_sql( "select name, char_id, account_id as aaa, ( select last_ip from login where account_id = aaa ) from `char` where online = 1", .@name$, .@aid, .@cid, .@ip$ );
	for ( .@i = 0; .@i < .@nb; ++.@i ) {		
		for ( .@j = 0; .@j < .@ip_list; ++.@j )			
			if ( .@b_ip$[.@j] == .@ip$[.@i] )				
			break;		
			if ( .@j == .@ip_list ) {			
				.@b_ip$[.@j] = .@ip$[.@i];			
				++.@ip_list;
			}		
	setd ".@b_ip"+ .@j +"_name$["+ .@b_ip_size[.@j] +"]", .@name$[.@i];		
	setd ".@b_ip"+ .@j +"_cid$["+ .@b_ip_size[.@j] +"]", .@cid[.@i] +"";		
	++.@b_ip_size[.@j];	
}	
	dispbottom "===== SAME IP Searching =====";	
	for ( .@i = 0; .@i < .@ip_list; ++.@i ) {
			if ( .@b_ip_size[.@i] > 1 ) {
				dispbottom "  == The IP ["+ .@b_ip$[.@i] +"] has "+ .@b_ip_size[.@i] +" players.";
					for ( .@j = 0; .@j < .@b_ip_size[.@i]; ++.@j ) {
						getmapxy .@map$, .@x, .@y, BL_PC, getd( ".@b_ip"+ .@i +"_name$["+ .@j +"]");
							dispbottom "    = "+( .@j +1 )+". ("+ getd( ".@b_ip"+ .@i +"_cid$["+ .@j +"]" ) +") "+ getd( ".@b_ip"+ .@i +"_name$["+ .@j +"]") +" -> "+ .@map$ +" "+ .@x +" "+ .@y;			
					}
						++.@result;	
			}
	}	
		dispbottom ">>> "+ .@result +" results found.";
		end;
}

i get error like this on console

[Error]: buildin_getmapxy: Player with map id '0' is not found.

Edited by melv0
wrong explains :D
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

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

LMAO !!! this script was made for over 4 years, and only today I found out it has a bug
http://herc.ws/board/topic/11445-sameip-command-for-rathena/

.@nb = query_sql( "select name, char_id, account_id as aaa, ( select last_ip from login where account_id = aaa ) from `char` where online = 1", .@name$, .@aid, .@cid, .@ip$ );

look closely, name, char_id, account_id, === BUT .@name$, .@aid, .@cid

up version 0.3

//===== Hercules Script ======================================
//= @sameip
//===== By: ==================================================
//= AnnieRuru
//===== Current Version: =====================================
//= 0.3
//===== Compatible With: ===================================== 
//= Hercules 2019-02-01
//===== Description: =========================================
//= list all players with same ip address
//===== Topic ================================================
//= https://rathena.org/board/topic/118137-error-buildin_getmapxy/
//===== Additional Comments: =================================  
//= it always list all players online, unable to limit to a single map currently
//============================================================

-	script	kjdshfksfj	FAKE_NPC,{
OnInit:
	bindatcmd "sameip", strnpcinfo(0)+"::Onaaa";
	end;
Onaaa:
	freeloop true;
	.@nb = query_sql( "select name, char_id, account_id as aaa, ( select last_ip from login where account_id = aaa ) from `char` where online = 1", .@name$, .@cid, .@aid, .@ip$ );
	for ( .@i = 0; .@i < .@nb; ++.@i ) {
		for ( .@j = 0; .@j < .@ip_list; ++.@j )
			if ( .@b_ip$[.@j] == .@ip$[.@i] )
				break;
		if ( .@j == .@ip_list ) {
			.@b_ip$[.@j] = .@ip$[.@i];
			++.@ip_list;
		}
		setd ".@b_ip"+ .@j +"_name$["+ .@b_ip_size[.@j] +"]", .@name$[.@i];
		setd ".@b_ip"+ .@j +"_cid["+ .@b_ip_size[.@j] +"]", .@cid[.@i];
		setd ".@b_ip"+ .@j +"_aid["+ .@b_ip_size[.@j] +"]", .@aid[.@i];
		++.@b_ip_size[.@j];
	}
	dispbottom "===== SAME IP Searching =====";
	for ( .@i = 0; .@i < .@ip_list; ++.@i ) {
		if ( .@b_ip_size[.@i] > 1 ) {
			dispbottom "  == The IP ["+ .@b_ip$[.@i] +"] has "+ .@b_ip_size[.@i] +" players.";
			for ( .@j = 0; .@j < .@b_ip_size[.@i]; ++.@j ) {
				getmapxy .@map$, .@x, .@y, UNITTYPE_PC, getd( ".@b_ip"+ .@i +"_aid["+ .@j +"]");
				dispbottom "    = "+( .@j +1 )+". ("+ getd( ".@b_ip"+ .@i +"_cid["+ .@j +"]" ) +") "+ getd( ".@b_ip"+ .@i +"_name$["+ .@j +"]") +" -> "+ .@map$ +" "+ .@x +" "+ .@y;
			}
			++.@result;
		}
	}
	dispbottom ">>> "+ .@result +" results found.";
	end;
}

 

EDIT: I think should write another version 0.4 since rathena has already upgrade the script engine quite some time ago
the only optimization I can think of is using inarray script command, so nah

Edited by AnnieRuru
  • Upvote 2
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

18 hours ago, AnnieRuru said:

LMAO !!! this script was made for over 4 years, and only today I found out it has a bug
http://herc.ws/board/topic/11445-sameip-command-for-rathena/


.@nb = query_sql( "select name, char_id, account_id as aaa, ( select last_ip from login where account_id = aaa ) from `char` where online = 1", .@name$, .@aid, .@cid, .@ip$ );

look closely, name, char_id, account_id, === BUT .@name$, .@aid, .@cid

up version 0.3


//===== Hercules Script ======================================
//= @sameip
//===== By: ==================================================
//= AnnieRuru
//===== Current Version: =====================================
//= 0.3
//===== Compatible With: ===================================== 
//= Hercules 2019-02-01
//===== Description: =========================================
//= list all players with same ip address
//===== Topic ================================================
//= https://rathena.org/board/topic/118137-error-buildin_getmapxy/
//===== Additional Comments: =================================  
//= it always list all players online, unable to limit to a single map currently
//============================================================

-	script	kjdshfksfj	FAKE_NPC,{
OnInit:
	bindatcmd "sameip", strnpcinfo(0)+"::Onaaa";
	end;
Onaaa:
	freeloop true;
	.@nb = query_sql( "select name, char_id, account_id as aaa, ( select last_ip from login where account_id = aaa ) from `char` where online = 1", .@name$, .@cid, .@aid, .@ip$ );
	for ( .@i = 0; .@i < .@nb; ++.@i ) {
		for ( .@j = 0; .@j < .@ip_list; ++.@j )
			if ( .@b_ip$[.@j] == .@ip$[.@i] )
				break;
		if ( .@j == .@ip_list ) {
			.@b_ip$[.@j] = .@ip$[.@i];
			++.@ip_list;
		}
		setd ".@b_ip"+ .@j +"_name$["+ .@b_ip_size[.@j] +"]", .@name$[.@i];
		setd ".@b_ip"+ .@j +"_cid["+ .@b_ip_size[.@j] +"]", .@cid[.@i];
		setd ".@b_ip"+ .@j +"_aid["+ .@b_ip_size[.@j] +"]", .@aid[.@i];
		++.@b_ip_size[.@j];
	}
	dispbottom "===== SAME IP Searching =====";
	for ( .@i = 0; .@i < .@ip_list; ++.@i ) {
		if ( .@b_ip_size[.@i] > 1 ) {
			dispbottom "  == The IP ["+ .@b_ip$[.@i] +"] has "+ .@b_ip_size[.@i] +" players.";
			for ( .@j = 0; .@j < .@b_ip_size[.@i]; ++.@j ) {
				getmapxy .@map$, .@x, .@y, UNITTYPE_PC, getd( ".@b_ip"+ .@i +"_aid["+ .@j +"]");
				dispbottom "    = "+( .@j +1 )+". ("+ getd( ".@b_ip"+ .@i +"_cid["+ .@j +"]" ) +") "+ getd( ".@b_ip"+ .@i +"_name$["+ .@j +"]") +" -> "+ .@map$ +" "+ .@x +" "+ .@y;
			}
			++.@result;
		}
	}
	dispbottom ">>> "+ .@result +" results found.";
	end;
}

 

EDIT: I think should write another version 0.4 since rathena has already upgrade the script engine quite some time ago
the only optimization I can think of is using inarray script command, so nah

thanks annie someone was help me to and working too with based your script ?
btw in last version rathena UNITTYPE_PC change into BL_PC


-	script	kjdshfksfj	FAKE_NPC,{
OnInit:    
    bindatcmd "sameip", strnpcinfo(0)+"::Onaaa", 14, 99;
    end;
Onaaa:    
    freeloop true;    
    .@nb = query_sql( "select name, char_id, account_id as aaa, ( select last_ip from login where account_id = aaa ) from `char` where online = 1", .@name$, .@cid, .@aid, .@ip$ );
    for ( .@i = 0; .@i < .@nb; ++.@i ) {    
        for ( .@j = 0; .@j < .@ip_list; ++.@j )     
            if ( .@b_ip$[.@j] == .@ip$[.@i] )             
                break;     
        if ( .@j == .@ip_list ) {      
            .@b_ip$[.@j] = .@ip$[.@i];            
            ++.@ip_list;
        }     
        setd ".@b_ip"+ .@j +"_name$["+ .@b_ip_size[.@j] +"]", .@name$[.@i];      
        setd ".@b_ip"+ .@j +"_cid$["+ .@b_ip_size[.@j] +"]", .@cid[.@i] +"";   
        setd ".@b_ip"+ .@j +"_aid["+ .@b_ip_size[.@j] +"]", .@aid[.@i] +"";
        ++.@b_ip_size[.@j];    
    }    
    dispbottom "===== SAME IP Searching =====";
    .@origin = getcharid(3);    
    for ( .@i = 0; .@i < .@ip_list; ++.@i ) {
        if ( .@b_ip_size[.@i] > 1 ) {
            dispbottom "  == The IP ["+ .@b_ip$[.@i] +"] has "+ .@b_ip_size[.@i] +" players.";
            for ( .@j = 0; .@j < .@b_ip_size[.@i]; ++.@j ) {
                .@rid = getd( ".@b_ip"+ .@i +"_aid["+ .@j +"]" ) + "";
                if (attachrid(.@rid)) {
                    getmapxy(.@map$, .@x, .@y);
                    attachrid .@origin;
                    dispbottom "    = "+( .@j +1 )+". ("+ getd( ".@b_ip"+ .@i +"_cid$["+ .@j +"]" ) +") "+ getd( ".@b_ip"+ .@i +"_name$["+ .@j +"]") +" -> "+ .@map$ +" "+ .@x +" "+ .@y;
                }
            }
            ++.@result;
        }
    }    
    dispbottom ">>> "+ .@result +" results found.";
    end;
}

 

Link to comment
Share on other sites

  • 0

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

1 hour ago, melv0 said:

btw in last version rathena UNITTYPE_PC change into BL_PC

of course I know, I mean com'on, this script only compatible with latest latest rathena,
because before that commit, rathena couldn't even insert RID on the getmapxy

 

btw I instantly recognized this is my script when I see npc name is  kjdshfksfj and account_id as aaa,  no other member do like this
I wonder where you got this script from ... because you say things like "my script not working anymore" and " someone was help me to and working too"

Edited by AnnieRuru
  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

8 hours ago, AnnieRuru said:

of course I know, I mean com'on, this script only compatible with latest latest rathena,
because before that commit, rathena couldn't even insert RID on the getmapxy

 

btw I instantly recognized this is my script when I see npc name is  kjdshfksfj and account_id as aaa,  no other member do like this
I wonder where you got this script from ... because you say things like "my script not working anymore" and " someone was help me to and working too"

sorry i don't mean like this ?

i mean "my script" actually I mean I use this script, and i don't claim this script made by me ? sorry my english not good ?

 

i choose wrong word ? 

ill edit the frist post ?

Edited by melv0
Link to comment
Share on other sites

  • 0

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

nonono, I thought you got scam that you bought this script from unknown person

you know, this happens a lot
I have a habit that most of my useful scripts are never put to release, and most of my scripts are hidden inside script request section
and I heard a few story that some scammer has claim my script as theirs and sell them in paid service

that's why now I have started to reorganize all my past work into my google drive

Edited by AnnieRuru
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

3 hours ago, AnnieRuru said:

nonono, I thought you got scam that you bought this script from unknown person

you know, this happens a lot
I have a habit that most of my useful scripts are never put to release, and most of my scripts are hidden inside script request section
and I heard a few story that some scammer has claim my script as theirs and sell them in paid service

that's why now I have started to reorganize all my past work into my google drive

I'm sorry for the misunderstand, and thanks for reminding of the scammer

im really sorry about that ?,if this offend you

i hope you can forgive me about this misunderstanding
 

btw, i just copy paste from that link without change anything from your posting
Here

Edited by melv0
typo
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  12
  • Reputation:   3
  • Joined:  01/13/18
  • Last Seen:  

Wrong comment

Edited by Ezra Edwin
Sorry wrong comment
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...