Skip to content

Commit

Permalink
Moving v0.2 changes up to master. (#7)
Browse files Browse the repository at this point in the history
Version 0.2.0

* Update SAMP.ahk

Added the getLastChatMessage( ) Function, and also the offset to the last message added to the ChatBox.

* Update README.md

* Update README.md

* Update SAMP.ahk

* Update README.md

* Update README.md

* Update README.md

* Rename LICENSE to LICENSE.txt

* Delete memorycodes.txt

* changed license type to MIT.

* Delete LICENSE.txt

* Rename LICENSE to LICENSE.txt

* Update README.md

* Update SAMP.ahk

* Update README.md

* Update README.md

Co-authored-by: EchoDRecho <[email protected]>
  • Loading branch information
mookums and EchoDRecho authored Apr 22, 2020
1 parent ce3d332 commit 878589b
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 351 deletions.
165 changes: 0 additions & 165 deletions LICENSE

This file was deleted.

21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 Kessec / The SAMPAHK Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
47 changes: 4 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# SAMPAHK
## SAMPAHK (v0.2)

![Image of Build Status](https://ci.appveyor.com/api/projects/status/ys6gm8pk3xg02pvx?svg=true)

Based off: [SAMPUDF](https://github.com/paul-phoenix/SAMP-UDF-for-AutoHotKey) by paul-phoenix

Expand Down Expand Up @@ -33,49 +35,8 @@ SetWorkingDir %A_ScriptDir%
#NoEnv
#SingleInstance force
#include %A_ScriptDir%\SAMP.ahk
Hotkey, Enter, Off
Hotkey, Escape, Off
bchat:=0
return
+T::
~t::
Suspend On
Hotkey, Enter, On
Hotkey, Escape, On
Hotkey, t, Off
return
~NumpadEnter::
~Enter::
Suspend Permit
Suspend Off
Hotkey, t, On
Hotkey, Enter, Off
Hotkey, Escape, Off
return
~Escape::
Suspend Permit
Suspend Off
Hotkey, t, On
Hotkey, Enter, Off
Hotkey, Escape, Off
return
Numpad1::
SendInput tName:{Space}
Suspend On
Hotkey, Enter, On
Hotkey, Escape, On
Input varName, V I M,{enter}
SendInput {end}+{home}{Del}{esc}
varID := getPlayerIdByName(varName)
showGameText(getPlayerNameById(varID) "~n~Score: " getPlayerScoreById(varID) "~n~Ping: " getPlayerPingById(varID), 2000, 5)
return
```

### REQUIREMENTS
#### [AutoHotKey](https://autohotkey.com) (32bit!)

Expand Down
26 changes: 24 additions & 2 deletions SAMP.ahk
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
; #### SAMPAHK ####
; SOFTWARE VERSION: v0.1.0
; https://github.com/sampudf/SAMPAHK
; https://github.com/kessec/SAMPAHK
; ####################

; UPDATE THIS OR YOUR MERGE WILL BE CLOSED.
; SOFTWARE VERSION: v0.2.0


; ErrorLevels
Expand Down Expand Up @@ -110,6 +111,7 @@ global FUNC_SAMP_STOPAUDIOSTR := 0x629A0
global FUNC_SAMP_SHOWDIALOG := 0x6B9C0
global FUNC_UPDATESCOREBOARD := 0x8A10

global SAMP_LAST_CHAT_MESSAGE_OFFSET := 0x62C6
global SAMP_INFO_OFFSET := 0x21A0F8
global SAMP_PPOOLS_OFFSET := 0x3CD
global SAMP_PPOOL_PLAYER_OFFSET := 0x18
Expand Down Expand Up @@ -160,6 +162,7 @@ global bCheckSizeOnce := 1
; # - getUsername() get local player name #
; # - getId() get local player id #
; # - sendChatMessage(wText) send a message to the server #
; # - getLastChatMessage() get the last message added to the ChatBox #
; # - addMessageToChatWindow(wText) add a "private" text to the chatbox #
; # - showGameText(wText, dwTime, dwTextsize) show a text on the sreen #
; # - showDialog(dwStyle, wCaption, show a dialog-box #
Expand Down Expand Up @@ -318,6 +321,25 @@ sendChatMessage(wText) {
return true
}

; get the last message added to the ChatBox.
getLastChatMessage(){
if(!checkHandles())
return ""
dwAddress := dwSAMP + ADDR_SAMP_CHATMSG_PTR
currentAddress := readDWORD(hGTA, dwAddress) + SAMP_LAST_CHAT_MESSAGE_OFFSET
if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY
return "Can not read from memory."
}
Message := readString(hGTA, currentAddress, 150)
if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY
return "Can not read from memory."
}
ErrorLevel := ERROR_OK
return Message
}

; similar to: http://wiki.sa-mp.com/wiki/SendClientMessage
; pass a string to add a private message to the chatbox
addMessageToChatWindow(wText) {
Expand Down
Loading

0 comments on commit 878589b

Please sign in to comment.