Jump to content

Recommended Posts

Posted

Here script for AutoFighter L2Net231

 

//**** Fighter script v0.2 ****//

//Remember to set weapon ID at line 133 and 137 (in the killtarget sub)

//****** User Settings ******//
DEFINE INT MIN_ATTACKDELAY 1500
DEFINE INT MAX_ATTACKDELAY 2500
DEFINE INT LOOT_RANGE 100
DEFINE INT MIN_PICKUPDELAY 150
DEFINE INT MAX_PICKUPDELAY 300
DEFINE INT MIN_TARGETDELAY 500
DEFINE INT MAX_TARGETDELAY 1000
DEFINE INT MOVETO_DISTANCE 400

//***********************Kite Stuff*********************//
DEFINE INT KiteRange 450
DEFINE DOUBLE VX 0
DEFINE DOUBLE VY 0
DEFINE DOUBLE VX1 0
DEFINE DOUBLE VY1 0
DEFINE DOUBLE LEN 0
//*****************************************************//

//*******time*******//
DEFINE INT StartTime 0
DEFINE INT EndTime 0
DEFINE INT UsedTime 0
DEFINE INT MaxTime 100000000
DEFINE INT MaxPickTime 50000000

//******Rest Settings******//
//set here at what hp/mp to rest. (in %)
DEFINE INT RESTHPPERCENT 40
DEFINE INT RESTMPPERCENT 0

DEFINE INT TEMP 0
DEFINE INT i 0
DEFINE INT TEN 10
DEFINE INT FOUR 4
DEFINE INT HUNDRED 100
DEFINE INT COUNT 0
DEFINE INT Rest 0
DEFINE INT RESTHP 0
DEFINE INT RESTMP 0
DEFINE INT SKILLMP 0
DEFINE INT DISTANCE_TO_TARGET 0
DEFINE INT PICKUP_X 0
DEFINE INT PICKUP_Y 0
DEFINE INT TEMPX 3
DEFINE DOUBLE X 0
DEFINE DOUBLE Y 0
DEFINE DOUBLE Range 50


MATH RESTHP CHAR_MAX_HP MULTIPLY RESTHPPERCENT
MATH RESTHP RESTHP DIVIDE HUNDRED
MATH RESTMP CHAR_MAX_MP MULTIPLY RESTMPPERCENT
MATH RESTMP RESTMP DIVIDE HUNDRED

//****** MAIN ******//

//just a printout 
PRINT_TEXT "rest below <&RESTHP&> HP"
DO
TARGET_NEAREST
GET_RAND TEMP "<&MIN_TARGETDELAY&>" "<&MAX_TARGETDELAY&>"
SLEEP "<&TEMP&>"
IF TARGET_CUR_HP > ZERO
	CALLSUB MovetoTarget
	SLEEP 500
	CALLSUB KillTarget
ENDIF	

//Target is dead, pick up
GET_TIME StartTime
SET PICKUP_X "<&CHAR_X&>"
SET PICKUP_Y "<&CHAR_Y&>"
	WHILE NEAREST_ITEM_DISTANCE < LOOT_RANGE
		GET_TIME EndTime
		MATH UsedTime EndTime SUBTRACT StartTime
		IF UsedTime > MaxPickTime
			BREAK 2
		ENDIF
		DISTANCE TEMP CHAR_X CHAR_Y TEMP PICKUP_X PICKUP_Y TEMP
		IF TEMP > LOOT_RANGE
			BREAK 2
		ENDIF
		CALLSUB Pickup
	WEND

	IF COUNT_NPC_TARGETME == ZERO
		IF CHAR_CUR_HP < RESTHP
			CALLSUB Rest
		ENDIF
	ENDIF
LOOP ZERO == ZERO
SCRIPT_END

//***************** SUBS *****************//
SUB MovetoTarget
SET i 0
GET_TIME StartTime
DISTANCE DISTANCE_TO_TARGET CHAR_X CHAR_Y CHAR_Z TARGET_X TARGET_Y TARGET_Z
IF DISTANCE_TO_TARGET <= MOVETO_DISTANCE
	RETURNSUB
ENDIF
SET TEMPX "<&TARGET_X&>"
MOVE_TO "<&TARGET_X&>" "<&TARGET_Y&>" "<&TARGET_Z&>"
WHILE DISTANCE_TO_TARGET > MOVETO_DISTANCE
                GET_TIME EndTime
	MATH UsedTime EndTime SUBTRACT StartTime
	DISTANCE DISTANCE_TO_TARGET CHAR_X CHAR_Y CHAR_Z TARGET_X TARGET_Y TARGET_Z
	GET_RAND TEMP "<&MIN_TARGETDELAY&>" "<&MAX_TARGETDELAY&>"
	SLEEP "<&TEMP&>"
	IF UsedTime > MaxTime
		CALLSUB Stuck
		RETURNSUB
	ENDIF	
	IF TARGET_X != TEMPX
		MOVE_TO "<&TARGET_X&>" "<&TARGET_Y&>" "<&TARGET_Z&>"
	ENDIF	
WEND
RETURNSUB
//******************************************************************************//
SUB KillTarget
GET_TIME StartTime
DO
	MATH i i ADD ONE
	PRINT_TEXT "Entering loop <&i&>"		
	GET_TIME EndTime
	MATH UsedTime EndTime SUBTRACT StartTime
	IF i == FOUR
		IF TARGET_CUR_HP == TARGET_MAX_HP
			USE_ITEM 13 //Equip Short Bow
			SLEEP 1000
			ATTACK_TARGET
			SLEEP 3500
			USE_ITEM 2543 //Equip duals
			SET i 0
		ENDIF
	ENDIF	
	IF UsedTime > MaxTime
		IF TARGET_CUR_HP == TARGET_MAX_HP
			CALLSUB Stuck
			RETURNSUB
		ENDIF
	ENDIF	
	ATTACK_TARGET
	GET_RAND TEMP "<&MIN_ATTACKDELAY&>" "<&MAX_ATTACKDELAY&>"
	SLEEP "<&TEMP&>"
LOOP TARGET_CUR_HP > ZERO
RETURNSUB
//******************************************************************************//
SUB Pickup
CLICK_NEAREST_ITEM
GET_RAND TEMP "<&MIN_PICKUPDELAY&>" "<&MAX_PICKUPDELAY&>"
SLEEP "<&TEMP&>"
RETURNSUB
//******************************************************************************//
SUB Rest
PRINT_TEXT "starting to rest"
SLEEP 1000
COMMAND "/sit"
//USE_SKILL 226
WHILE CHAR_CUR_HP < CHAR_MAX_HP
	IF COUNT_NPC_TARGETME != ZERO
		COMMAND "/stand"
		RETURNSUB
	ENDIF
SLEEP 1000
WEND
//done resting lets stand
COMMAND "/stand"
SLEEP 200
RETURNSUB
//******************************************************************************//
SUB Stuck
//need to get a vector for from the monster to us
MATH VX CHAR_X SUBTRACT TARGET_X
MATH VY CHAR_Y SUBTRACT TARGET_Y
//now we have the vector from the target to us... lets normalize it now
DISTANCE LEN ZERO ZERO ZERO VX VY ZERO
MATH VX VX DIVIDE LEN
MATH VY VY DIVIDE LEN
//now lets scale back up to our range
MATH VX VX MULTIPLY KiteRange
MATH VY VY MULTIPLY KiteRange
SET VX1 "<&VX&>"
SET VY1 "<&VY&>"	
//then we add this offset to our location
MATH VX VX ADD CHAR_X
MATH VY VY ADD CHAR_Y
//and finally... we move
MOVE_TO "<&VX&>" "<&VY&>" "<&CHAR_Z&>" 
SLEEP 1500
//left turn
MATH VX CHAR_X SUBTRACT VY1
MATH VY CHAR_Y ADD VX1
MOVE_TO "<&VX&>" "<&VY&>" "<&CHAR_Z&>"
SLEEP 1500
MOVE_TO "<&TARGET_X&>" "<&TARGET_Y&>" "<&TARGET_Z&>"
SLEEP 1500
RETURNSUB


//**** Developed by Oddi 2007 ****//
//Thanks to Slothmo & Asmodin88 for providing useful pre-code

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • ## [1.5.5] - 2026-02-02   ### ✨ New Features - **Discord Login**: You can now sign in with your Discord account. Admins enable and configure Discord login in **cpadmin → Users** (Discord auth settings: Client ID, Client Secret, Redirect URI). If you already have an account with the same email (e.g. forum, Google, or legacy), signing in with Discord links to that account so you keep one profile. Discord login is available on Add Server, My Servers, Vote page, and Premium Ads booking. - **Setup Links**: In **cpadmin → Users**, both Google and Discord login settings now include direct links to their official developer portals (Google Cloud Console and Discord Developer Portal) for easier OAuth app setup.   ### 🔒 Security - **Email Required for Registration**: New user registration via OAuth (Forum, Google, Discord) now requires a valid email address. If the OAuth provider doesn't provide an email (e.g. unverified Discord email), registration is rejected with a clear message. This prevents anonymous accounts and ensures all users can receive important notifications.   ### 🔄 Improvements - **User Auth Badges**: In **cpadmin → Users**, the Registered Members table now shows auth method badges: **Forum**, **Google**, **Discord**, or **Legacy**. Users can have multiple badges if they've linked multiple login methods. - **Server Info Labels**: Translated server info labels (Owner Name, Language, Server Location) are now properly localized in all 5 languages (English, Spanish, Portuguese, Greek, Russian).   ---   ## [1.5.4] - 2026-02-01   ### ✨ New Features - **Google Login**: You can now sign in with your Google account. Admins enable and configure Google login in **cpadmin → Users** (Google auth settings: Client ID, Client Secret, Redirect URI). If you already have an account with the same email (e.g. forum or legacy), signing in with Google links to that account so you keep one profile. The login menu (navbar and login prompts) offers **Login with Forum Account**, **Login with Google** (when enabled), and **Create Forum Account**. Google login is available on Add Server, My Servers, Profile Settings, Vote page, and Premium Ads booking. - **Ban/Unban Members**: In **cpadmin → Users**, admins can ban or unban registered members. Banned users see a full-page message: "Sorry, you are banned from using this site." When a user is banned, all their servers are set to inactive. - **Moderator Activity Log**: **cpadmin → Moderators** now records when a moderator or admin enters the CPAdmin panel (e.g. "Moderator X entered CPAdmin panel at &lt;time&gt;") and when they change any cpadmin settings (only write actions are logged; read-only use is not). - **Clear Moderator Logs**: Admins can clear all moderator activity log entries via a **Clear logs** button with confirmation. Logs are shown at 100 per page with pagination. - **Filter by Moderator**: In the Moderator Activity Log, a **Filter by moderator** dropdown lets you view activity for a specific moderator or "All moderators." - **cpadmin → Users Tab**: New **Users** tab in the admin panel with Registered Members list (paginated), Google auth settings card, and per-user Ban/Unban and server links.   ### 🔄 Improvements - **cpadmin → Servers**: Each server name in the servers table is now clickable and opens that server’s info page. - **cpadmin → Users – Servers column**: The servers count/list is clickable and opens a small modal listing that user’s servers; each server name in the modal links to the server info page. - **cpadmin → Users – Search**: A search bar above the Registered Members table lets you search by **username**, **email**, or **server name**. Results are filtered on the server (paginated); clearing the search resets the list. - **Moderator Activity Log**: Pagination shows "Showing X–Y of Z" and "Page N of M" with Previous/Next when there are more than 100 entries. - **Login UI**: Login options (Forum, Google, Create account) are shown in a consistent dropdown and in modals (Add Server, My Servers, Vote, Premium Ads) for a clearer sign-in experience. - **Vote Page – Unauthenticated**: When you must log in to vote, the page now shows "Vote for [Server Name]" as the main heading and presents login options in a compact section.   ---   ## [1.5.3] - 2026-01-30   ### ✨ New Features - **File Logs in Admin Panel**: Admins can now view CodeIgniter PHP logs (api/writable/logs) directly in **cpadmin → Logs**. Select a date to view the log file, refresh to reload, or delete all log files to free up space.   ### 🔄 Improvements - **Cache System**: Full cache audit and improvements — when you clear cache in cpadmin, both backend and frontend caches are cleared. Server listings, My Servers, pricing, ad config, and chronicles all refresh with fresh data. New paid servers now appear in listings and My Servers immediately. - **Admin Panel – Server Rates**: Server rates in the admin servers table now display in compact format (e.g. x10000 → x10k, x100000 → x100k, x1000000 → x1m) for easier scanning. Hover to see the full value.
    • WTB High Five source running on Salvation/Fafurion client
    • MoMoProxy has updated more static residential proxies for USA location, anyone interested in can view: https://momoproxy.com/static-residential-proxies
    • Hello, i am selling a project that was going to open but at the end i have not the time to do it Its a c4 server ( scripts) with all the c5 changes played from Interlude Client    the server is 1:1 copy of the legendary 2007 L2Revenge server with some bits like events and some more sync stuff There is a lot of retail fixes included  , extender is vanganth and has a lot of mods but mostly fixes on the retail stuff.   Test server is available through discord , i offer client/patch/server/sources The price is 300 Euro and for testing the server you have to pm me at discord banshee1019 , dont really wanna let anybody log because some people are "bad"   Once you buy you also have free support for 1 year , that doesnt mean i will code all your ideas but support you if something comes up , and guide you to do simple edits
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..