Jump to content
  • 0

Overwriting user function


Noctis

Question


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  226
  • Reputation:   13
  • Joined:  02/17/15
  • Last Seen:  

How to solve? it worked before why is not working now o.o, 

//this is the function 
script    D_huntermark    {
    return (countitem(1004) > 0 || countitem(1006) > 0);
}

//And I used this to call the function
if (!callfunc("D_huntermark")) {

 

 

eeeeeee.png

Edited by Noctis
Link to comment
Share on other sites

21 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  226
  • Reputation:   13
  • Joined:  02/17/15
  • Last Seen:  

Update: It works, but still say overwriting o.O

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

You have that function two times. Search in a file you are suspicious about or use the search in multiple files function in Sublime Text or Notepad++.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  226
  • Reputation:   13
  • Joined:  02/17/15
  • Last Seen:  

2 minutes ago, n0tttt said:

You have that function two times. Search in a file you are suspicious about or use the search in multiple files function in Sublime Text or Notepad++.

I have another file that call that function, its because of that? 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

2 hours ago, Noctis said:

I have another file that call that function, its because of that? 

No, I mean you have another function script with that name. Calling doesn't resolve in the message you shown.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  226
  • Reputation:   13
  • Joined:  02/17/15
  • Last Seen:  

8 hours ago, n0tttt said:

No, I mean you have another function script with that name. Calling doesn't resolve in the message you shown.

I have only 1 file with that function, thats why its weird

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  98
  • Reputation:   74
  • Joined:  12/04/14
  • Last Seen:  

On 6/27/2017 at 5:36 AM, Noctis said:

How to solve? it worked before why is not working now o.o, 


//this is the function 
script    D_huntermark    {
    return (countitem(1004) > 0 || countitem(1006) > 0);
}

//And I used this to call the function
if (!callfunc("D_huntermark")) {

 

 

try closing the function script with "end;"

 

function	script	D_huntermark    {
    return (countitem(1004) > 0 || countitem(1006) > 0);
end;
}

 

Edited by Keitenai
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  226
  • Reputation:   13
  • Joined:  02/17/15
  • Last Seen:  

3 minutes ago, Keitenai said:

 

try closing the function script with "end;"

 


script    D_huntermark    {
    return (countitem(1004) > 0 || countitem(1006) > 0);
end;
}

 

still says overwriting, so weird...

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  98
  • Reputation:   74
  • Joined:  12/04/14
  • Last Seen:  

function	script	D_huntermark    {
    return (countitem(1004) > 0 || countitem(1006) > 0);
end;
}

 

add the "function" on your script

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  226
  • Reputation:   13
  • Joined:  02/17/15
  • Last Seen:  

1 minute ago, Keitenai said:

function	script	D_huntermark    {
    return (countitem(1004) > 0 || countitem(1006) > 0);
end;
}

 

add the "function" on your script

Ye I added

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  98
  • Reputation:   74
  • Joined:  12/04/14
  • Last Seen:  

try check all your custom scripts and see if there's a duplicated function as @n0tttt suggests 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  226
  • Reputation:   13
  • Joined:  02/17/15
  • Last Seen:  

4 minutes ago, Keitenai said:

try check all your custom scripts and see if there's a duplicated function as @n0tttt suggests 

I dont think so, already checked, I even tried to change the function name :/ 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  98
  • Reputation:   74
  • Joined:  12/04/14
  • Last Seen:  

post the full script. perhaps a revision is needed

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  226
  • Reputation:   13
  • Joined:  02/17/15
  • Last Seen:  

@Keitenai

Edited by Noctis
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  98
  • Reputation:   74
  • Joined:  12/04/14
  • Last Seen:  

Try this:

 

			if(!countitem(47007)){

 

Edited by Keitenai
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  226
  • Reputation:   13
  • Joined:  02/17/15
  • Last Seen:  

but now the 

function	script	D_huntermark  is gone xD
 [EDIT]
it worked, but cant find the function in the script o.O, how can it work without the function lol @Keitenai
Edited by Noctis
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  98
  • Reputation:   74
  • Joined:  12/04/14
  • Last Seen:  

are you using it for other script?

if so then you can just change the:

if (!callfunc("D_huntermark")) {

in to this:

if(!countitem(47007)){

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  98
  • Reputation:   74
  • Joined:  12/04/14
  • Last Seen:  

or try to remove the "||" on your function:

 

function	script	D_huntermark	{
	return (countitem(47007) > 0);
}

 

and keep everything else as it was

;)

Edited by Keitenai
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  226
  • Reputation:   13
  • Joined:  02/17/15
  • Last Seen:  

7 minutes ago, Keitenai said:

are you using it for other script?

if so then you can just change the:


if (!callfunc("D_huntermark")) {

in to this:


if(!countitem(47007)){

 

Ye Im using for other script, then I dont need to call the function anymore?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  98
  • Reputation:   74
  • Joined:  12/04/14
  • Last Seen:  

No need to make additional function for item check, plus you will also free a small portion of your server resources by removing the function script. :)

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  226
  • Reputation:   13
  • Joined:  02/17/15
  • Last Seen:  

1 minute ago, Keitenai said:

No need to make additional function for item check, plus you will also free a small portion of your server resources by removing the function script. :)

Thanks for the help, so now instead of calling the function, I use 

if(!countitem(47007)){?
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  98
  • Reputation:   74
  • Joined:  12/04/14
  • Last Seen:  

yeap

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