Jump to content

TJWho

Members
  • Posts

    2
  • Joined

  • Last visited

TJWho's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Lets see, One way to do this is use the _Skype_CallGetStatus function. Look for the word ";TCallStatus" in the Skype UDF. That will give you all the different call status that you can look for. Here is an example if you want them to pick up first and then it will drop the call. #include "Skype.au3" local $user = "lolpork" $oCall = _Skype_CallCreate($user) While 1 ;Wait for them to answer then drop the call if _Skype_CallGetStatus($oCall) = $cClsInProgress then ExitLoop WEnd _Skype_CallFinish($oCall) Hope this is what you looking for.
  2. I'v been tinkering around with the Skype UDF and got a script that auto replies to chat when a user enters a special command. Example: >> !time . I feel it could help other people with the, "Skype_OnEvent" functions. This was pieced together and taken from an old example. Amazing work btw, FireFox for making this udf. Was also wondering if there was a better way to respond to a chat directly from a message. Right now i'm using, "$oMsg.Chat.SendMessage". Thanks! Example code below: ;Made by TJWho... ; ;You or a friend can message you with the following commands ; ;!help ;!time ;!slap [Person] ;!8ball [question] ;all the dice commands do the same thing ;!roll ;!DICE 20 ;!RANDOM 1-100 ;!RAND 3d3 ;#include <Skype.au3> ;Depending on where your skype.au3 is at. #include "Skype.au3" _Skype_Start() ;in case not running #Region Variables Global $oChat, $blChat = False Global $oCall, $blCall = False, $blCallHold = False Global $sCurrUserHandle = _Skype_ProfileGetHandle() Global $sDealUserHandle #EndRegion Variables #Region Skype_OnEvent _Skype_OnEventAttachmentStatus("_AttachmentStatus") _Skype_OnEventMessageStatus("_ChatMessage", $cCmsSent) _Skype_OnEventMessageStatus("_ChatMessage", $cCmsReceived) _Skype_OnEventError("_Error") #EndRegion Skype_OnEvent ;Taken from a 8ball.ini file #region 8ball.ini local $a8ball[29] $a8ball[0] = "Maybe..." $a8ball[1] = "As I see It, Yes" $a8ball[2] = "It is certain" $a8ball[3] = "It is decidedly so" $a8ball[4] = "Most likely" $a8ball[5] = "Outlook good" $a8ball[6] = "Signs point to Yes" $a8ball[7] = "Without a doubt" $a8ball[8] = "YES" $a8ball[9] = "Yes, definitely" $a8ball[10] = "You may rely on it" $a8ball[11] = "Ask again later" $a8ball[12] = "Better not tell you now" $a8ball[13] = "Cannot predict now" $a8ball[14] = "Concentrate and ask again" $a8ball[15] = "Don't count on it" $a8ball[16] = "My reply is No" $a8ball[17] = "My sources say No" $a8ball[18] = "Outlook not so good" $a8ball[19] = "Reply Hazy, Try again" $a8ball[20] = "Very doubtful" $a8ball[21] = "Not only no, but HELL No!" $a8ball[22] = "Not only yes, but HELL Yes!" $a8ball[23] = "You will regret it!" $a8ball[24] = "Signs point to No" $a8ball[25] = "Go away... I don't want you back!" $a8ball[26] = "Well I love you, come back!" $a8ball[27] = "What? Are you taking me as an 8 ball?" $a8ball[28] = "Outlook is disturbing" #endregion 8ball.ini ;// Sleep While 1 Sleep(1) WEnd ;// Where the event gets called too Func _ChatMessage($oMsg) DecodeMsg($oMsg) If $oSkype.Convert.ChatMessageTypeToText($oMsg.Type) = "unknown" Then AutoChat($oMsg) EndIf if $oSkype.Convert.ChatMessageTypeToText($oMsg.Type) = 'Said' then AutoChat($oMsg) EndIf EndFunc ;==>_ChatMessage ;// The DecodeMsg event handler decodes messages in a chat and converts leave reasons to text for messages of type "Left": Func DecodeMsg($oMsg) $sText = $oMsg.FromHandle & " " & $oSkype.Convert.ChatMessageTypeToText($oMsg.Type) & ":" If StringLen($oMsg.Body) Then $sText = $sText & " " & $oMsg.Body EndIf Dim $oUser For $oUser In $oMsg.Users $sText = $sText & " " & $oUser.Handle Next #cs If $oMsg.Type = $cMessageType_Left Then $sText = $sText & " " & $oSkype.Convert.ChatLeaveReasonToText($oMsg.LeaveReason) EndIf #ce ConsoleWrite($sText & @LF) EndFunc Func _AttachmentStatus($TAttachmentStatus) ;the Skype UDF will automatically attach to skype when this one will be available EndFunc ;// $oMsg.Chat.SendMessage responds with a message Func AutoChat($oMsg) local $sTemp = StringSplit($oMsg.Body," ") switch $sTemp[1] case '!time' $time = _DateDayOfWeek(@WDAY)&" "&_DateToMonth(@MON)&" "&@MDAY&" "&@YEAR&" -- "&@HOUR&":"&@MIN&":"&@SEC $oMsg.Chat.SendMessage('/me >>'&$time) ;Tuesday November 27 2012 -- 21:49:50 -05:00 case '!help' $oMsg.Chat.SendMessage('/me >>'&help_list()) case '!roll','!DICE','!RANDOM','!RAND' $oMsg.Chat.SendMessage('/me >>'&DICE($oMsg.body)) EndSwitch if $sTemp[0] = 1 then return 0 Switch $sTemp[1] case '!slap' $oMsg.Chat.SendMessage('/me >>'&$oMsg.FromHandle & ' slaps '&$sTemp[2]&' around a bit with a large trout') case '!8ball' $i = Random (0, UBound($a8ball) -1) $oMsg.Chat.SendMessage('/me >>'&$a8ball[$i]) EndSwitch EndFunc Func DICE($d='') ;ConsoleWrite("BEFORE: "&$d & @LF) local $regname = '(?x)(?i)!((roll)|(DICE)|(RANDOM)|(RAND))' $d = StringRegExpReplace($d,$regname,"") ;ConsoleWrite("AFTER: "&$d & @LF) if $d = '' then return Random(1,100,1) local $tempd,$templ local $Wrong = 'Invalid Syntax!' $regexp = "(?x)(?i)(([1-9]d[1-9])|([0-9]{0,4}-[0-9]{0,4})|([0-9]{0,4}))" if Not StringRegExp($d,$regexp) Then return $Wrong $tempd = StringSplit($d,"d") if $tempd[0] = 1 Then $templ = StringSplit($d,"-") if $templ[0] = 1 Then return Random(1,int($d),1) return Random($templ[1],$templ[2],1) Else local $n = int($tempd[1]) if $n > 1000 then Return "Its too BIG!!!" local $str = '' While True if $n = 0 then ExitLoop $str &= '.'&Random(1,$tempd[2],1) $n -=1 WEnd return StringRight($str,StringLen($str)-1) EndIf return $Wrong EndFunc Func help_list() local $str = "Current list of commands:" & _ "!HELP,!ROLL,!SLAP,!TRIVIABOT,!TIME,!8BALL" Return $str EndFunc Func _Error($iError, $sError) ConsoleWrite("iERROR: "&$iError&"sERROR: "& $sError & @LF) EndFunc Func _Exit() Exit EndFunc ;==>_Exit
×
×
  • Create New...