Hey people :)

05/19/2017 02:36 yarin1115#1
can Anyone post please sql for send auto Item to all characters.
like Daily Item but Auto, like every 24 hours :handsdown:
05/19/2017 02:46 ViihJana#2
If i dont mistake its a SQL job .
05/19/2017 03:50 yarin1115#3
yes as I thought, but you know what is the sql code for it ?
05/19/2017 04:47 ViihJana#4
Well i don't know it , but if i remember in one of the threads some guy posted it with a tutorial how to create a job .
05/19/2017 07:51 [DEV]Dekaron#5
use search
@[Only registered and activated users can see links. Click Here To Register...] to close.
05/19/2017 12:37 yarin1115#6
Quote:
Originally Posted by [DEV]Dekaron View Post
use search
@[Only registered and activated users can see links. Click Here To Register...] to close.
Already Searched. I always search before create topic.
Do not be arrogant.

@[Only registered and activated users can see links. Click Here To Register...] to don't Close.
05/19/2017 13:18 guesswho-.-#7
I'm just gonna point out a few problems with what you're trying to do:
if it runs every 24h, people will create accounts and characters just to "farm" the reward. then again if its so insignificant then there's no point having it at all.
you're better off sending a reward to people who spent some time in game. could be once a day, but make it so that they stay 10 mins in game or so.

what I'd probably do is edit the user_character table and add 2 int columns which will be default 0. then add a job that will increment one of the columns for every character that is logged in every 60 seconds (but only if the 2nd column is 0), and also modify SP_CHAR_CHECK_IN to set the column to 0.
then another job which will distribute the reward to everyone who has reached 10 (and 2nd column == 0) in that column and set the 2nd column to 1.

I'm not gonna give you the code for it. SQL is piss easy and with minimal effort you will do it. If you have any SQL experience you'll do it in 5 mins, otherwise I'd guess about 2 hours.


btw, I'm not a SQL expert, this is what works for me, I dont know if there are any more efficient methods.
05/19/2017 13:45 yarin1115#8
I want to make it 24hours on the clock, If the specific user won't log after 10 days the reward will delete. it's untraded. got my idea ?
05/19/2017 14:29 Underfisk#9
yarin as guess said and he said right you can add a extra table for set the time which player has logged in and sql has some functions you just need to check if the time he logged - your current time is equal to the result that you want, if yes then you can give reward for the player.
Iam at phone atm can't handle the query but it isnt hard
05/19/2017 14:34 guesswho-.-#10
Yes but my idea is the that you write the code yourself. Sql is probably easier than dealing with csv files.
05/19/2017 15:05 [DEV]Dekaron#11
Quote:
Originally Posted by yarin1115 View Post
Already Searched. I always search before create topic.
Do not be arrogant.

@[Only registered and activated users can see links. Click Here To Register...] to don't Close.
yes im sure you use search i find this in 5 sec
[Only registered and activated users can see links. Click Here To Register...]
05/19/2017 15:06 Alborzar#12
google is your bestfriend :)
05/19/2017 15:07 yarin1115#13
Quote:
Originally Posted by guesswho-.- View Post
Yes but my idea is the that you write the code yourself. Sql is probably easier than dealing with csv files.
not for everyone, I'm good in csv and not in sql :p

Quote:
Originally Posted by [DEV]Dekaron View Post
yes im sure you use search i find this in 5 sec
[Only registered and activated users can see links. Click Here To Register...]

Thanks, I will try to make add time for this
05/19/2017 20:28 Underfisk#14
@[Only registered and activated users can see links. Click Here To Register...] search for SQL time func, after it just make a table or even the account last logged in works (i guess), check the time he logged out + the extra time you want like 10 min or more and see if that loggedout + the extra is > than the actual time (of sv ofc).
Gl, its just one idea (i never made that ofc reward but i guess it could work, but there can be more easier implementations)
05/20/2017 01:31 freez00#15
You will need to either program this using a stored procedure in SQL or in another language. either way you need to program it.

You need to capture the character number from the character table. So a query and loop around the results. In the loop, execute the SP_POST_SEND_OP stored procedure and put in the character number, subject, message, item index number.

Save your stored procedure and set a job to run it every 15 minutes etc. Right-click jobs under sql server agent and select new job. Give it a name, create the steps to run the stored procedure, set the schedule and you're done!

I haven't seen any scripts here that are pre-made that do this but this is an easy way to make an automated task without a lot of programming knowledge.