Sign in to follow this  
Followers 0
Fr33b0w

Coverting Chars (Facebook Emoticons)

3 posts in this topic

Hi. I am trying whole day yesterday and today to make script work. Code shouldnt be a problem but I just dont understand how some characters work. I will try to explain. I have a bunch of chars that I picked up from http://fsymbols.com/emoji/ and if you paste them in facebook page they work fine. But if you paste more then 20 or 40 (I am not sure anymore) they will not show well. Same thing happens in a script. When I had less then 20 everything worked fine. Now when I put much more it wont work. For example if code is "ΓÿÇ" then I need to get " " when it goes trough code and that worked fine. When I put much more in a script it just wouldnt work. Same happens on facebook page. I have just checked it shows first 40 and then it wont decode others. Same happens in script. I even changed a bit way it works and instead that code is inside script i have put it in a .txt file so it will just load a line i need trough scrip (to make it work somehow) but it just doesnt work. Can anyone solve this ghost inside a script?

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>




$hGUI = GUICreate("v3.00", 752, 418, -1, -1)
;GUICtrlSetStyle(-1, )
GUICtrlSetFont(-1, 8.5, 400, 0, "MS Shell Dlg", 5)
$oIE = ObjCreate("Shell.Explorer.2")
;GUICtrlSetStyle(-1, )
$hPic = GUICtrlCreatePic("", 13, 33, 16, 16)
GUICtrlSetImage(-1, "E:\0\autoit\2014-03-31 Facebook Spec Chars\img\01.bmp")
$hPic2 = GUICtrlCreatePic("", 13, 51, 16, 16)
GUICtrlSetImage(-1, "E:\0\autoit\2014-03-31 Facebook Spec Chars\img\02.bmp")
$hButton = GUICtrlCreateButton("#", 37, 33, 16, 16)
$hButton2 = GUICtrlCreateButton("#", 37, 51, 16, 16)
$hButton3 = GUICtrlCreateButton("#", 37, 69, 16, 16)
$hButton4 = GUICtrlCreateButton("#", 37, 87, 16, 16)
$hButton5 = GUICtrlCreateButton("#", 37, 105, 16, 16)
$hButton6 = GUICtrlCreateButton("#", 37, 123, 16, 16)
$hButton7 = GUICtrlCreateButton("#", 37, 141, 16, 16)
GUISetState()




While 1
    $hMsg = GUIGetMsg()
    Switch $hMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
Select
        Case $hMsg = $hButton
            ClipPut("ðŸ") ; those are chars that needs to be inserted in a facebook
        Case $hMsg = $hButton2
            ClipPut("â˜") ; here also
        Case $hMsg = $hButton3
            ClipPut("☔")
        Case $hMsg = $hButton4
            ClipPut("⛄")
        Case $hMsg = $hButton5
            ClipPut("âš¡")
        Case $hMsg = $hButton7
            ClipPut("")
EndSelect
WEnd

At the end I need to get "

Share this post


Link to post
Share on other sites



Emoticons and stuff like that are processed by the site. Emoji are usually Fonts that just change how chars are represented. 

If it's a problem of them not showing it would likely be because of the chars or collection of chars conflicting with each other. 
Basically you need either time between each paste and/or Spaces between them. 

Or I could be completely confused as to what you're after. 


A true renaissance man

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

First of all much thanks for your answer because I am desperate to solve this. Strange thing about this is that sometimes I get from a script one result and then complitely other. Its not connected to a browser or a site. But similar thing happens on a site. Since I cant paste them here you could look at some examples in here: (cant post direct link but search for "Interesting-WEB-Links"). Its new group I oppened to test stuff so it has nothing to do with advertising. Since it reacts same way as script I see no better way to show my problem...  Here results are breaking the code and cant be shown... There I did some tests and I can paste you there exact results which I am getting from a script.

EDIT: If anyone had problem with a special chars that goes trough autoit code and then change itself for no proper reason (at least known to me), please give me some hint. Thank you! OS is XP...

REEDIT: In some emotic0ns there was 4th char missing and that caused a bug. Dont know how because those ones wasnt even triggered by user (me)... now I am trying to reedit the whole thing...

Edited by Fr33b0w

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0

  • Similar Content

    • FengHuangWuShen
      By FengHuangWuShen
      So I was playing with INet and downloading files and made a simple video downloader, or it can even be used for any file really.
      Just follow the reference section in INet_Settings.ini , and then run the script.
       
      Main Script #include <INet.au3> #include <InetConstants.au3> #include <WinAPIFiles.au3> #include <Array.au3> #include <String.au3> OnAutoItExitRegister('INET_CLOSE') $GET_URL = _INetGetSource(IniRead(@ScriptDir & '\Inet_Settings.ini', 'Request', 'Url', Default)) $STRING_START = IniRead(@ScriptDir & '\Inet_Settings.ini', 'Data', 'Start', Default) $STRING_END = IniRead(@ScriptDir & '\Inet_Settings.ini', 'Data', 'End', Default) $GET_STRING = _StringBetween ($GET_URL, $STRING_START, $STRING_END) $VIDEO_URL = _ArrayToString($GET_STRING) $VIDEO = _URIDecode($VIDEO_URL) If StringLen($VIDEO) > 0 Then Local $VIDEO_DIR = (@ScriptDir & '\' & Random(1, 65535) & '.mp4') Local $DOWNLOAD_VIDEO = InetGet($VIDEO, $VIDEO_DIR, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND) Do Sleep(IniRead(@ScriptDir & '\Inet_Settings.ini', 'Settings', 'Delay', Default)) Until InetGetInfo($DOWNLOAD_VIDEO, $INET_DOWNLOADCOMPLETE) InetClose($DOWNLOAD_VIDEO) Else MsgBox(0, 'DEBUG', "Video doesn't exist") EndIf Func INET_CLOSE() InetClose($DOWNLOAD_VIDEO) EndFunc Func _URIEncode($sData) ; Prog@ndy Local $aData = StringSplit(BinaryToString(StringToBinary($sData,4),1),"") Local $nChar $sData="" For $i = 1 To $aData[0] ; ConsoleWrite($aData[$i] & @CRLF) $nChar = Asc($aData[$i]) Switch $nChar Case 45, 46, 48 To 57, 65 To 90, 95, 97 To 122, 126 $sData &= $aData[$i] Case 32 $sData &= "+" Case Else $sData &= "%" & Hex($nChar,2) EndSwitch Next Return $sData EndFunc Func _URIDecode($sData) ; Prog@ndy Local $aData = StringSplit(StringReplace($sData,"+"," ",0,1),"%") $sData = "" For $i = 2 To $aData[0] $aData[1] &= Chr(Dec(StringLeft($aData[$i],2))) & StringTrimLeft($aData[$i],2) Next Return BinaryToString(StringToBinary($aData[1],1),4) EndFunc  
      INet_Settings.ini  URL - The target URL of the video you're trying to grab Data - This is the starting string, and ending string reference to look for the download URL itself. Settings - Only setting here currently, is the delay in which to wait for the file to download ### Reference for Start and End points for various websites [Request] Url = https://www.facebook.com/lindseystirlingmusic/videos/1527732263925622/ [Data] Start = hd_src_no_ratelimit:" End = " [Settings] Delay = 250 ################################################################################################### Instagram : https://www.instagram.com/p/Video ID Or : https://www.instagram.com/p/Video ID/?taken-by=User ID Start = video:secure_url" content=" End = " Facebook : https://www.facebook.com/User ID/videos/Video ID/ Or : Right click on the video and copy URL Start = hd_src_no_ratelimit:" End = " Start = sd_src_no_ratelimit:" End = " ###################################################################################################  
      Credits to : https://www.autoitscript.com/forum/profile/31965-progandy/  for the URL Encode and Decode.
    • KimberlyJillPereira
      By KimberlyJillPereira
      May I know how to copy the first 10 characters in excel and paste it in the file explorer textbox? How to do? I know that you show use the StringLeft() function but I am not sure how to do. Please help me. Thank you! 


    • FrancescoDiMuro
      By FrancescoDiMuro
      Good morning
      I was trying to replace 2 identical characters from a string, but I didn't manage to with StringReplace()...
      Does anyone know how to replace two ( i.e. : """" with ";" ) ? 
      Thanks  
    • fopetesl
      By fopetesl
      Need to read a small file which looks like
      01 01 01 00 21 21 48 4F ����!HHO (cut from hexedit) First four are binary but don't show, last four are ascii "!HHO"
      I have tried to split the file and look for the ascii string but not succeeded:
      ; Set the working directory ... or set PATH! ... FileChangeDir("C:\S3_GUI\ncat\") ; Run(@ComSpec & " /k " & "C:\S3_GUI\ncat\Home.bat", "", @SW_HIDE);;comment: not over write Local $hFileOpen = FileOpen("C:\S3_GUI\ncat\homerep", $FO_READ) ;; homerep Local $sFileRead = FileRead($hFileOpen) Local $Comp = StringInStr ($sFileRead,"!HHO",1,4) If( $Comp = 1) Then MsgBox($MB_OK, "Head is Home", "!HHO") Else MsgBox($MB_OK, "Head not Home!","!HHx") EndIf Fails every time.
      If I open it as binary then I lose the ascii?
      I've been advised to include the whole file but it's getting big. You need to see it all?
    • TheSaint
      By TheSaint
      I had a need, and so I developed.
      Before I did that though, I did a quick search of the forum, and found a few things, but none seemed to suit what I really wanted ... though to be honest, I did not investigate them deeply or search extensively. In any case, I am not very good at modifying the code of others, nor do I enjoy doing so, so in the end I decided it was best to start from scratch ... re-inventing the wheel perhaps, but a wheel I feel a certain degree of comfort with. I also thought about Maps, but don't know enough.
      _IniString Functions (was Ini_InMem)
      Ini in memory
      Settings INI - Read/Write once to the disk
      INI File Processing Functions
      ... sure to be others.
      As with all my stuff, feel free to use (no guarantees) or modify ... just give me credit where due.
      I always go for the quick & simple approach, as those who know me here, are well aware, so without a doubt, my code could be improved - sped up, RegExp used, etc. So feel free to do that, and convert into a proper UDF, if you want, following best practices etc, as I am sure others will appreciate it.
      Recently, I have come upon a need to extract data from an approximately 50 Mb downloaded Index file, just extracting the few elements I need, and storing them in an INI file. It is quite a time consuming process, especially on my underpowered Netbook, which is where I am using the program I built. I have been considering ways to speed up things. Two good sounding methods, out of several possibles, have come to mind - 1) RAM Disk and 2) Virtual INI processing. That last being a better option, when sharing code (program) with others.
      Another method, which I am currently using, that did give me some measurable benefit, was to download the almost 50 Mb Index file in Stages (i.e. 30 x 1.4 Mb roughly), extracting data from each in turn. I have also considered extracting to 10 (or 11) separate INI files, rather than the single large INI file (4~5 Mb), as things noticeably slow up as the INI file increases in size ... obviously due to writing time.
      I can't really speed up the extraction process, but that last method may speed up the writing stage.  However, it would require significant program changes, and perhaps not gain me much benefit. To complicate things, there are too many Section names (Index ID's) for the IniReadSectionNames command, so I have had to split them off into their own (read/write) line-by-line index file, and create code to deal with duplicates. When read, Index ID's and Titles populate a Listbox control in a user GUI.
      So at this point in time, it seems best to use the Virtual INI approach to gain a significant reduction in time taken. For my own specific use, with my slow Netbook, I may also use a RAM Disk.
      Due to the aforementioned INI issues, and lack of available specific data, probably because it is always  program concentric, I have created an ASCII Checker program, which I guess you can say, is AutoIt  concentric. Because others may also find it handy, I am providing it here. NOTE - As yet, I am only aware that Escape characters exist, but have not investigated or catered for them in any way.
      ASCII Checker.zip

      The Virtual_INI_UDF is still a work in progress, though I have done most of the functions now, with the working but incomplete _Ini_Test function, still requiring changes etc from the information gleaned by the ASCII Checker program.
      Here's something to play with meanwhile.
      Updated files (24th February 2017)
      Virtual_INI_UDF.au3  NEW
      Example.au3 (23rd February 2017)
      All pretty basic, but managed to load my 4 Mb INI file (seemingly ok, but took a few seconds) ... though I have only worked with much smaller testing ones so far.
      P.S. While I have done a fair amount of testing, it has been pretty basic, and mostly limited to the examples provided. Testing has definitely not been extensive.