Jump to content
  • 0

Having problems with this src code


Echoes

Question


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  155
  • Reputation:   6
  • Joined:  03/30/13
  • Last Seen:  

Hello :D

I was testing an script about some botcheck stuff, but this needed a src modification, so I found where to look at but when I try to recompile the server, those errors are shown:

In file included from script.c:19170:
../custom/script.inc: In function ‘buildin_botcheck’:
../custom/script.inc:67: error: ‘struct s_state’ has no member named ‘botcheck’
../custom/script.inc:68: error: ‘struct s_state’ has no member named ‘botcheck’
../custom/script.inc:70: error: ‘struct s_state’ has no member named ‘botcheck’
make[1]: *** [obj/script.o] Error 1
make[1]: Leaving directory `rAthena/src/map'
make: *** [map] Error 2

This is the script I add on script_def.inc:

BUILDIN_DEF2(botcheck,"botcheck",""),

And for script.inc:

BUILDIN_FUNC(botcheck)
{
	TBL_PC *sd;

	sd=script_rid2sd(st);
	if( sd == NULL )
		return 0;

67:	if (!sd->state.botcheck) {
68:		sd->state.botcheck = 1;
	} else {
70:		sd->state.botcheck = 0;
	}

	return 0;
}

^Numbers added to specify script line count, they are not on the real script.

 

I don't know what is wrong, this is like my 5th time trying to do some source modification so, I don't know what to do to fix this error :C (and know nothing about source code)

And of course I want the script running on the server lol

 

 

Thanks in advance :D!

Edited by Echoes
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  816
  • Reputation:   236
  • Joined:  01/30/13
  • Last Seen:  

I'm not sure what you want to do with that.

But the error is just as it says, the object "state" has no variable "botcheck".

Everything sd can contain is defined in pc.h:

https://raw.githubusercontent.com/rathena/rathena/master/src/map/pc.h

	struct s_state {
		unsigned int active : 1; //Marks active player (not active is logging in/out, or changing map servers)
		unsigned int menu_or_input : 1;// if a script is waiting for feedback from the player
		unsigned int dead_sit : 2;
		unsigned int lr_flag : 3;//1: left h. weapon; 2: arrow; 3: shield
		unsigned int connect_new : 1;
		unsigned int arrow_atk : 1;
		unsigned int gangsterparadise : 1;
		unsigned int rest : 1;
		unsigned int storage_flag : 2; //0: closed, 1: Normal Storage open, 2: guild storage open [Skotlex]
		unsigned int snovice_dead_flag : 1; //Explosion spirits on death: 0 off, 1 used.
		unsigned int abra_flag : 2; // Abracadabra bugfix by Aru
		unsigned int autocast : 1; // Autospell flag [Inkfish]
		unsigned int autotrade : 1;	//By Fantik
		unsigned int reg_dirty : 4; //By Skotlex (marks whether registry variables have been saved or not yet)
		unsigned int showdelay :1;
		unsigned int showexp :1;
		unsigned int showzeny :1;
		unsigned int noask :1; // [LuzZza]
		unsigned int trading :1; //[Skotlex] is 1 only after a trade has started.
		unsigned int deal_locked :2; //1: Clicked on OK. 2: Clicked on TRADE
		unsigned int monster_ignore :1; // for monsters to ignore a character [Valaris] [zzo]
		unsigned int size :2; // for tiny/large types
		unsigned int night :1; //Holds whether or not the player currently has the SI_NIGHT effect on. [Skotlex]
		unsigned int blockedmove :1;
		unsigned int using_fake_npc :1;
		unsigned int rewarp :1; //Signals that a player should warp as soon as he is done loading a map. [Skotlex]
		unsigned int killer : 1;
		unsigned int killable : 1;
		unsigned int doridori : 1;
		unsigned int ignoreAll : 1;
		unsigned int debug_remove_map : 1; // temporary state to track double remove_map's [FlavioJS]
		unsigned int buyingstore : 1;
		unsigned int lesseffect : 1;
		unsigned int vending : 1;
		unsigned int noks : 3; // [Zeph Kill Steal Protection]
		unsigned int changemap : 1;
		unsigned int callshop : 1; // flag to indicate that a script used callshop; on a shop
		short pmap; // Previous map on Map Change
		unsigned short autoloot;
		unsigned short autolootid[AUTOLOOTITEM_SIZE]; // [Zephyrus]
		unsigned short autoloottype;
		unsigned int autolooting : 1; //performance-saver, autolooting state for @alootid
		unsigned int autobonus; //flag to indicate if an autobonus is activated. [Inkfish]
		unsigned int gmaster_flag : 1;
		unsigned int prevend : 1;//used to flag wheather you've spent 40sp to open the vending or not.
		unsigned int warping : 1;//states whether you're in the middle of a warp processing
		unsigned int permanent_speed : 1; // When 1, speed cannot be changed through status_calc_pc().
		unsigned int hold_recalc : 1;
		unsigned int banking : 1; //1 when we using the banking system 0 when closed
		unsigned int hpmeter_visible : 1;
		unsigned disable_atcommand_on_npc : 1; //Prevent to use atcommand while talking with NPC [Kichi]
	} state;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  155
  • Reputation:   6
  • Joined:  03/30/13
  • Last Seen:  

Thank you so much Playtester!

 

I added the pc.h script line missing and now it works!

 

Really, thank you!

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...