Jump to content
  • 0

getpetinfo error


Aaeria

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  12
  • Reputation:   0
  • Joined:  06/02/17
  • Last Seen:  

I'm new to scripting and trying to make a basic petinfo command. But I get error, can someone help me to right way? This what I put so far:

-	script	atcmds	-1,{
OnInit:
	bindatcmd "petinfo",strnpcinfo(3)+"::OnAtcommand1";
	end;

OnAtcommand1:
	if( getpetinfo(PETINFO_ID()) == null ) {
	dispbottom "Sorry, you do not own a pet yet.";
	break;
	} else {
	dispbottom "[Pet] "+getpetinfo(petinfo_id())+"";
	end;
	}
}

a79a52f10b66b1996df21d0392451547.png

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  235
  • Reputation:   55
  • Joined:  12/02/11
  • Last Seen:  

24 minutes ago, Aaeria said:

I'm new to scripting and trying to make a basic petinfo command. But I get error, can someone help me to right way? This what I put so far:


-	script	atcmds	-1,{
OnInit:
	bindatcmd "petinfo",strnpcinfo(3)+"::OnAtcommand1";
	end;

OnAtcommand1:
	if( getpetinfo(PETINFO_ID()) == null ) {
	dispbottom "Sorry, you do not own a pet yet.";
	break;
	} else {
	dispbottom "[Pet] "+getpetinfo(petinfo_id())+"";
	end;
	}
}

a79a52f10b66b1996df21d0392451547.png

 

Try this.

-	script	atcmds	-1,{
OnInit:
	bindatcmd "petinfo",strnpcinfo(3)+"::OnAtcommand";
	end;

OnAtcommand:
	if( getpetinfo(PETINFO_NAME) == "null") {
		dispbottom "Sorry, you do not own a pet yet.";
		end;
	} else {
		dispbottom "=========== Information ===========";
		dispbottom "ID: "+getpetinfo(PETINFO_ID)+"";
		dispbottom "Block ID: "+getpetinfo(PETINFO_BLOCKID)+"";
		dispbottom "Level: "+getpetinfo(PETINFO_LEVEL)+"";
		dispbottom "Class: "+getpetinfo(PETINFO_CLASS)+"";
		dispbottom "Name: "+getpetinfo(PETINFO_NAME)+"";
		dispbottom "Hungry: "+getpetinfo(PETINFO_HUNGRY)+"";
		dispbottom "Renamed: "+getpetinfo(PETINFO_RENAMED)+"";
		end;
	}
}

 

Edited by Kaze
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  12
  • Reputation:   0
  • Joined:  06/02/17
  • Last Seen:  

15 minutes ago, Kaze said:

 

Try this.


-	script	atcmds	-1,{
OnInit:
	bindatcmd "petinfo",strnpcinfo(3)+"::OnAtcommand";
	end;

OnAtcommand:
	if( getpetinfo(PETINFO_NAME) == "null") {
		dispbottom "Sorry, you do not own a pet yet.";
		end;
	} else {
		dispbottom "=========== Information ===========";
		dispbottom "ID: "+getpetinfo(PETINFO_ID)+"";
		dispbottom "Block ID: "+getpetinfo(PETINFO_BLOCKID)+"";
		dispbottom "Level: "+getpetinfo(PETINFO_LEVEL)+"";
		dispbottom "Class: "+getpetinfo(PETINFO_CLASS)+"";
		dispbottom "Name: "+getpetinfo(PETINFO_NAME)+"";
		dispbottom "Hungry: "+getpetinfo(PETINFO_HUNGRY)+"";
		dispbottom "Renamed: "+getpetinfo(PETINFO_RENAMED)+"";
		end;
	}
}

 

Thank you, it worked. ++

Appreciate it, learned from this.

Here's the basic pet info if someone wants:

 

-	script	atcmds	-1,{
OnInit:
	bindatcmd "petinfo",strnpcinfo(3)+"::OnAtcommand1";
	end;

OnAtcommand1:
	if( getpetinfo(petinfo_name) == "null" ) {
		dispbottom "Sorry, you do not own a pet yet.";
	end;
	} else {
		dispbottom "[Pet Info] (Lv. "+getpetinfo(petinfo_level)+") Nickname: "+getpetinfo(petinfo_name)+" - Intimacy Score: "+getpetinfo(petinfo_intimate)+" - Hunger: "+getpetinfo(petinfo_hungry)+"%";
	end;
	}
}

 

Edited by Aaeria
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...