EventScripts Forums
Mattie's EventScripts and Source Forums
Script Categories
16000 (15) abilities (15) addon (72) addons (17) admin (354) admins (23) advert (29) adverts (27) afk (18) alerts (12) ammo (25) anti (21) armor (11) auth (16) automatic (15) awp (29) ban (24) bank (11) ba_jail (35) bhop (46) block (27) bomb (48) bonus (25) boost (22) bot (36) bot-management (20) bots (24) bullet (13) bunnyhop (19) Buy (27) buymenu (13) c4 (12) cash (77) Change (14) chat (77) cheat (15) clan (17) classes (24) color (30) colors (20) command (23) commands (21) config (28) configurable (11) connect (58) counter (12) Counter-Strike-Source (20) CS:S (20) css (3385) custom (13) Damage (49) database (14) dead (19) Deagle (11) death (20) deathmatch (79) deathrun (17) deutsch (15) dice (12) disconnect (26) Dissolve (12) dm (24) dod:s (11) dods (501) download (13) easy (26) effect (14) effects (126) English (16) entity (24) est (12) es_tools (14) Eventscript (12) exploit (11) flashbang (27) français (104) french (36) fun (312) funny (18) Gabeee (11) game (12) gamemode (12) gameplay (175) German (11) give (22) gravity (16) grenade (28) grenades (32) gun (16) GunGame (31) GunGame5 (11) guns (20) Hack (16) headshot (37) health (72) hegrenade (15) help (11) hit (13) hl2dm (442) HP (26) hudhint (13) hun (17) hungarian (26) info (52) information (19) invisible (11) IP (13) jail (81) jailbreak (14) join (47) jump (19) kick (25) kill (51) kills (24) knife (66) leveling (38) LnD (14) lol (11) magyar (48) management (14) manager (11) mani (16) map (32) map-management (26) maps (17) match (22) Memphis-84 (13) menu (144) message (34) messaging (52) minecraft (12) mod (121) model (18) models (33) modye (16) money (50) motd (13) music (32) mute (20) nades (20) name (15) new (13) noblock (54) orangebox (23) player (49) player-management (31) player-tracking (28) popup (72) prop (13) propmenu (14) props (34) protect (12) protection (32) punish (11) punishment (51) python (80) quake (32) QuakeSounds (12) race (13) races (20) radio (30) random (47) rank (42) rates (15) rcon (12) realism (22) Regeln (23) respawn (69) restrict (41) round (26) rpg (32) rules (63) say (17) score (16) scout (29) Script (25) script-helper (25) scriptpack (33) sdk (171) server (61) server-tools (42) shop (12) showdamage (20) silly (31) simple (33) skin (17) skins (34) slay (13) soccer (14) sound (67) sounds (107) source (14) spanish (18) spawn (82) speed (26) statistics (14) stats (57) status (15) Steam (11) STEAMID (30) Superhero (15) surf (41) Team (30) team-balance (14) teleport (17) text (19) TF2 (142) time (23) timer (15) tools (15) tracers (19) triggers (11) uedi (17) uses_auth (18) vip (24) vote (39) voting (22) war (25) Warcraft (12) warcraft-source (20) wc3 (14) wcs (47) wcs:Python (32) weapon (88) weapons (120) web (16) welcome (14) wuerfeln (11) zm (26) zombie (100) zombiemod (55) zombies (12)
Script Authors
*XYZ*SaYnt (12) .:MiB:. (20) .:modye:. (14) .eMko* (6) 101satoon101 (12) 3R10N (24) 4u571n91 (5) 7355608 (9) Absolute (9) Ace Rimmer (40) adminc (5) adyshor37 (5) Adz (8) AgathaKnuppelkuh (8) aidden (8) ajax (5) ak_47 (6) Al3c Tr3v3lyan (6) allstareng (5) ashbash1987 (9) ATAMAH (7) Ayuto (5) aznone (5) B00M (5) BackRaw (41) BFH_RedBull (8) bigfabi (8) Bioko (10) blackshoxx (9) Blade (10) bladesback (13) bobdole (11) bodzsar1 (8) bonbon (36) Brainsucker (32) cagemonkey (8) capo azzlack (7) captain master (6) carbon-14 (10) CaskioUTF (5) cbirou (15) CbRRR (16) ChaCaLz2psy4 (5) CharlesT (5) Chris1888 (5) Chrisber (5) chrismrulz (10) Chun (6) cladiron (10) clipz934 (8) Colster (21) Cookieman8 (7) CrAzD (6) craziest (11) dani12356 (12) DanielB (19) Darkness123 (8) Dave (9) dbozan99 (7) dead man walker (12) deathx9 (5) Deathyy (16) dhack (17) Di[M]aN (12) DJ Fire-Black prod (8) DoCky (31) Don (15) dordtcore (9) DragonFreddo (8) Drassil (5) dretax14 (11) Einlanzers (47) EmbouT (10) emilplov (7) Errant (10) Eun (6) Fantole (10) FMIS (5) Franc1sco (17) freddukes (18) Frequency (6) Fridge (5) Fugi91 (6) Fulmine (5) G4ME (5) GAMEREN2 (8) german9114 (13) GODJonez (40) GoodfellaDeal (5) Hansi (6) Hisoka (6) HitThePipe (7) HOLLDIDAY (24) Icetouch (6) ichthys (25) Im the new guy (14) iNexus (13) infamous1 (9) isivisi (13) ispaine (7) Jackmaster (9) Jeff91 (45) JoeyT2006 (30) Juba_PornBorn (12) jxl180 (11) KDBFame (6) L'In20Cible (11) L.P.H (8) Largo Usagi (10) LnD (14) Lobe (11) loKkdoKk (8) lolo-le-haricot (7) LosNir (5) Lumpi@Work (9) M4rc3L-XCN (7) macshot (7) magyar-oneill (9) Matth (7) Mattie (21) mave1993 (5) MBchrono (15) McFly (20) Medda (5) Memphis-84 (15) Messiah93 (20) Mickyy (5) micmacx (6) minimal42O (5) Mitchell (5) Mixer57 (5) modye (6) Monster_Bitch1 (9) Mordavolt (7) motomoto (21) MrScriptaz (6) mryoung (6) MyTechZone.de (9) Nicolous (23) ojii (31) oliVier (10) Omega68 (6) Omega_K2 (11) Owned|Myself (8) P3N (7) pand3mic (6) parsimba (5) Pascal257 (9) PatPeter (7) PDrop (10) Phaedrus (18) PhantOm Fury (7) phoenix131 (9) pinkyyy -.- (5) pitbull0993 (7) PixelGamer (7) qwern (5) randomknifer (9) Raptor150 (31) Ratzee (6) ReaCtioN2oo9 (6) RedCliff (5) Rennnyyy (17) revolutionfighters (8) RideGuy (12) Rio (9) Roeliekt (6) roof (16) runamagic (13) Ryezin (5) sandking220 (6) Sarcasm_Poisoning (10) saRs| Johnny-5 (13) Schubaal (10) sea212 (5) sega74rus (15) sgt.angel (6) Shad0w (11) ShoTaXx# (7) sicilia (7) sicman_adrian (22) skillz92 (7) sn4k3 (18) Snake12 (7) snake38 (10) sonicsight (7) SpeedFreak (9) spoonman184 (12) stabby (22) stas (27) Stirni (6) stonedegg (8) Strontium Dog (30) SumGuy14 (25) SuperDave (49) surfteam (5) TaCo (5) TanaToS (17) Tealk (6) teowow (16) TheCheeTaH (27) TheDonFather (5) theresthatguy (6) Tiny Tod (7) tooshkan4uk (8) Totyahun (9) uedi (38) ultimatebuster (6) Undead (25) usernamesaretaken (15) wanted241 (9) Warren (13) westham (6) WhiteAvenger (7) Wonder (14) Wundermaxe (5) X-Mania (5) XE_ManUp (14) xfalcon61 (5) zSweetXz (5) ZZMatty (6) [Cs]Lord_Inferno2 (11) [DAP]Kickbutt (5) [NATO]Hunter (28) ||Wolf|| (10)
Search

Post new topic This topic is locked, you cannot edit posts or make further replies.
Go to page 1, 2, 3, 4, 5 ... 47  Next
Author Message
User avatar
Moderator
Moderator
Profile

Posts: 582
 
New postPosted: 2009-02-24, 3:13 pm 
   Post subject: [07-02-2013] Source Python Extensions!

Documentation (thanks XE_Manup!):
Documentation

What's new?
Quote:
============================
VERSION: 1.5.0f
DATE: 5/22/12
============================
Python side:
* Fixes for the latest update.


SPE lets you signature scan for a function and call it. This means you can call ANY function that you can grab a signature for. The windows version is completely working (at least, according to the first few beta testers). The linux build is also complete, meaning this should theoretically work for all EP1 games. Please test, and post responses! :D

On a final note, this plugin is licensed under the GNU GPL v3 license meaning it is open source. Hence, my SVN is here.

It's still a WIP, but I hope that people will be willing to test something this incredible (at least IMHO).

Whew, with that out of the way, these are the requirements for this plugin:

Quote:
  • Eventscripts v2.0.0.248+
  • A gameserver running ANY source engine game.
  • The responsibility to use the plugin wisely. It's incredibly powerful.


And without further ado, here you go! If you have any questions or comments, send me a PM over the forums and I will reply. If you have any contributions to our simple library, don't hesitate to send a PM :)

Thanks!

People I'd like to thank::
  • Monday..because I can.
  • Scott "DamagedSoul" Ehlert for the mmap symbol finding technique.
  • The guys over at dyncall.org for their awesome libraries.
  • Einlanzers for testing EVERYTHING POSSIBLE in SPE.
  • Mattie and predcrab: For listening to my problems and grumblings about random crashes
  • LDuke for teaching me how to sigscan in the first place.
  • XE_Manup for helping me write the library in a more "pythonic" fasion.
  • tnbporsche911 for giving me valuable debug information!
  • Everyone who helped test this (even though there is more testing to be done!).
  • dvander for his wonderful signature scanner.
  • theY4Kman for various tips and tricks!
  • Gabe Newell.

:arrow: MUST READ:
I will not take any responsibility for any damage that occurs if you use this plugin. You use this at your own risk. I will not be held responsible for any system downtime, crashes, or the like that result through the use of this plugin. I offer it to the community for the benefit of learning and exploration. I've tried my best to test it, but there may be bugs. If so, please post in this thread.


Last edited by your-name-here on 2009-12-15, 3:51 am, edited 40 times in total.

User avatar
Moderator
Moderator
Profile

Posts: 582
 
New postPosted: 2009-02-24, 5:52 pm 

I've updated the first post with a new library design for SPE. Please remove spe from your eventscripts/_libs/ folder and upload this version instead.

Basically, you can actually import game specifc shortcuts now! Currently, I only have cstrike done, but I'll get to the other games as I have time!

Here is a sample respawn script for CS:

PYTHON:
    #====================================================
    # Imports
    #====================================================
    import es
    from spe.games import cstrike

    #====================================================
    # Game events
    #====================================================
    def load():

        es.regsaycmd("!respawn", "lol/respawn", "Respawns a player.")
       
    def unload():

        es.unregsaycmd("!respawn")

    def respawn():

        userid = es.getcmduserid()
       
        cstrike.respawn( userid )
       
        es.tell(userid, "You've been respawned!")


NOTE: With the 03/17 update, you can now just import cstrike from spe.games. You do not have to deal with getting player pointers or anything! Woot!

There is also a generic module, which is imported into every game module. So in essence, if you want to create an entity in cs, you could just do

PYTHON:
    cstrike.createEntity("env_explosion")
Without having to do cstrike.generic.createEntity.

And if you wanted to do this for hl2dm, all you'd have to do is
PYTHON:
    hl2dm.createEntity("env_explosion")


Last edited by your-name-here on 2009-08-28, 2:19 pm, edited 5 times in total.

User avatar
Mentat
Mentat
Profile

Posts: 4782
Location:
C:/Program Files/Bonbon/Bonbon.exe
 
New postPosted: 2009-02-24, 8:10 pm 

Vai nice, you still haven't gotten it working on my server, though ;) If you ever need a linux OB TF2 server, I got one of those too, lol (And I'm pretty sure it doesn't use colons, 99% sure) And you said that it can't pass invalid parameter types, as in integer versus string userids? Since all event variables return strings, and most new scripters don't know that (Some don't even know the difference between a string, and an int!) could you call spe.getPlayer with a string userid?

_________________
SicmanAdrian wrote:
I don't think it is possible but maybe SuperDave could try?

abcdefghijklmnopqrstuvwxyz
"It doesn't work" doesn't help us out, help us help you, be more specific!
Remember, when posting non Python code, post in the ES 1.x discussion forum, you'll get better help!
SuperDave wrote:
It's very difficult to see errors in that script because it is some of the worst looking code I have ever seen. And I've seen bonbon's code

Please do not PM for free private scripts/help!


User avatar
Guru
Guru
Profile

Posts: 1448
Location:
Toronto
 
New postPosted: 2009-02-24, 8:33 pm 

bonbon wrote:
Vai nice, you still haven't gotten it working on my server, though ;) If you ever need a linux OB TF2 server, I got one of those too, lol (And I'm pretty sure it doesn't use colons, 99% sure) And you said that it can't pass invalid parameter types, as in integer versus string userids? Since all event variables return strings, and most new scripters don't know that (Some don't even know the difference between a string, and an int!) could you call spe.getPlayer with a string userid?

You need to pass an integer.


User avatar
Moderator
Moderator
Profile

Posts: 582
 
New postPosted: 2009-02-24, 8:53 pm 

bonbon wrote:
Vai nice, you still haven't gotten it working on my server, though ;) If you ever need a linux OB TF2 server, I got one of those too, lol (And I'm pretty sure it doesn't use colons, 99% sure) And you said that it can't pass invalid parameter types, as in integer versus string userids? Since all event variables return strings, and most new scripters don't know that (Some don't even know the difference between a string, and an int!) could you call spe.getPlayer with a string userid?


Meh, I mean I could just add a spe.player( userid ) function which converts for them. :D

EDIT: I reread your question. With spe.getPlayer, you do need an integer. The invalid parameter thing I was referring to deals with calling the sigscanned function. If you pass a pointer as a float, that's asking for problems (of course, the plugin catches such errors).


User avatar
Guru
Guru
Profile

Posts: 1609
Location:
Location: Location:
 
New postPosted: 2009-02-24, 10:47 pm 

I've always wanted something like this! :D

Maybe make the module name a little more elaborate? Like es_ext because spe is a little ambiguous.

_________________
- Saul

All code I give out is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 license.


User avatar
EventScripts Administrator
EventScripts Administrator
Profile

Posts: 3541
Location:
Germany
 
New postPosted: 2009-02-24, 11:32 pm 

Saul wrote:
Maybe make the module name a little more elaborate? Like es_ext because spe is a little ambiguous.


Ugh! No underscores in Python module names, please.

Nice work, your-name-here, keep it coming.


User avatar
Moderator
Moderator
Profile

Posts: 582
 
New postPosted: 2009-02-25, 12:16 am 

Saul wrote:
I've always wanted something like this! :D

Maybe make the module name a little more elaborate? Like es_ext because spe is a little ambiguous.


Heh, it was originally Eventscripts Extensions, however there is an upcoming python interface for SourceMod. This will support that, so it'd be kinda weird if it was EventScripts Extensions on SM :P

People already complained about too many underscores, but read on for my idea. :P

[NATO]Hunter wrote:
Nice work, your-name-here, keep it coming.

You're welcome ;D

I'm still working out some kinks on the linux build. Please please please test the current linux build :)

On a side note, what would you guys think of a module for each game? Like a cstrike module, a tf2 module, an hl2dm module, etc?


Last edited by your-name-here on 2009-03-17, 8:23 pm, edited 1 time in total.

User avatar
Guru
Guru
Profile

Posts: 1609
Location:
Location: Location:
 
New postPosted: 2009-02-25, 12:51 am 

No! Brilliant concept, terrible execution. You've just completely broken any ideas for cross-game mods.

You want something like:
from spe import game

The game module contains a load of utility functions that are general to mods (i.e. respawn, Weapon_Owns, Weapon_CanUse, etc.)

Then have from spe import cstrike which contains cstrike-related functions, etc. etc.

You get the point... good luck ;D

_________________
- Saul

All code I give out is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 license.


User avatar
EventScripts Administrator
EventScripts Administrator
Profile

Posts: 3541
Location:
Germany
 
New postPosted: 2009-02-25, 12:56 am 

I prefer the ini version, because it handles everything itself. I don't care about the game, if a function exists in all games, but has a different address/symbol, I still want to use it without doing game-checks on my own.

And Saul, your way is not much better..


User avatar
Moderator
Moderator
Profile

Posts: 582
 
New postPosted: 2009-02-25, 1:44 am 

[NATO]Hunter wrote:
I prefer the ini version, because it handles everything itself. I don't care about the game, if a function exists in all games, but has a different address/symbol, I still want to use it without doing game-checks on my own.


Actually, in the future, I plan on autoloading a "generic.ini" file with all the cross-mod compatible signatures when you import spe. Then, the library will load up the game specific signatures (i.e. cstrike.ini) and what we can do is, if a signature is different for a game, it will be overridden by the game specific .ini, making it so that even if the generic signature is different, you will still have the correct one! :D

On a second note, here is the feature list I am shooting for:

Quote:
  • Virtual Function Calls.
  • Virtual method Hooking (probably by embedding sourcehook).
  • Function detours


To explain, virtual function calls only need an integer offset, which denotes what "slot" the function that you want to call is in, inside the object's virtual method table. You do not need signatures to do this. However, offsets are much more likely to change than a signature, so using virtual offsets increases the likelihood that a crash will occur.

With virtual method hooking, I'll probably embed sourcehook when I get the chance, which will allow the registering of a python callback function which will be called when the virtual function that you "hook" will be called. Think of this as something like the event "player_death". When this is called, it performs its thing, and then execution is passed to your script's "player_death" function / method which you can then do your own stuff in ;D

Finally, function detours are the same thing as virtual method hooking, but the difference is you can hook non-virtual methods using this.

I'd really appreciate some feedback on how both builds are working.

Here are a few topics I'd like info on:
Quote:
  • Have you experienced any crashes?
  • Do you have any big plans with this? :D
  • Is there anything you would like to see included in spe.py?
  • Are there any signatures you would like to be added?


Thanks!


Last edited by your-name-here on 2009-03-01, 10:39 pm, edited 1 time in total.

User avatar
Guru
Guru
Profile

Posts: 1343
 
New postPosted: 2009-03-01, 6:56 pm 

Wow, this sounds amazing. Nice work!

I have alot of work on at the moment, but when I get the chance I'll test this and let you know how it goes.

british.assassin

_________________
Image


User avatar
Moderator
Moderator
Profile

Posts: 582
 
New postPosted: 2009-03-01, 10:31 pm 

Heh, it just got better. Mattie helped me out immensely with the linux build. This plugin now functions on linux servers!


User avatar
EventScripts Administrator
EventScripts Administrator
Profile

Posts: 3090
Location:
UK
 
New postPosted: 2009-03-02, 5:33 am 

That INI loading thing is super easy with ConfigObj.

You can just load the generic one with ConfigObj and then merge the game specific one into it (just make sure you dont "save" the ConfigObj class - or you might want to update the file path once loaded to a garbage one :)).

_________________
Cheers,
Tom
Image
NCS: kill chat spam dead! - | - Get Live IRC help - | - Addon Utils - View and manage addons in game
(No IRC client? Use this sites simple online version [Requires Java])

eXtensible Admin: the #1 open source admin tool

Addons: Uptime; server uptime logger - loglib; logging utility - Block Chat; limit chat to teamonlly - Last Five; view the last few players to leave the server, with ban opts - Backup; coming SOON

My startup: social network v3.0!!


User avatar
Moderator
Moderator
Profile

Posts: 582
 
New postPosted: 2009-03-04, 9:04 pm 

Heh, I take it that everyone is too busy :(

I would REALLY appreciate some feedback on how this is working. I bust my tail for 5 weeks making this, gimme 5 minutes of your time :P

Plus you'll all get an e-cookie :D


User avatar
EventScripts Administrator
EventScripts Administrator
Profile

Posts: 4290
Location:
Michigan
 
New postPosted: 2009-03-13, 1:17 pm 

Feature Requests
- Mic muting per user.
- Effect per user. (so only one person can see the effect)

Now both of these exist in EST/Mani but not in ES, so I assume they use some method of sigscanning. I just hope you can add them to the ini.

Thanks,
Einlanzers

_________________
Image


User avatar
Moderator
Moderator
Profile

Posts: 582
 
New postPosted: 2009-03-13, 9:06 pm 

Einlanzers wrote:
Feature Requests
- Mic muting per user.
- Effect per user. (so only one person can see the effect)

Now both of these exist in EST/Mani but not in ES, so I assume they use some method of sigscanning. I just hope you can add them to the ini.

Thanks,
Einlanzers


Unfortunately, that requires that I hardcode it into the C++ plugin (at first glance).

I will look into this tomorrow :)


User avatar
Guru
Guru
Profile

Posts: 1609
Location:
Location: Location:
 
New postPosted: 2009-03-14, 5:36 am 

your-name-here, what is the concept of it? Limiting where the effect is sent? I'm guessing this requires hooking of CBroadcastRecipientFilter (think thats it)?

Correct me if I'm wrong (which I most likely am).

_________________
- Saul

All code I give out is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 license.


Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 840 posts ]  Go to page 1, 2, 3, 4, 5 ... 47  Next


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group